mongodb

command
v0.0.0-...-0b0a695 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

README

MongoDB plugin

Plugin to query MongoDB (https://www.mongodb.com) as a data source.

Compile with:

go build -buildmode=plugin -ldflags="-w" -o mongodb.so ./*.go

Access details

Source YAML definition's access fields:

  • addr: HOST:PORT database's access point, for example - localhost:27017
  • db: database name to use
  • collection: collection name to query

Get all the possible fields

As MongoDB doesn't provide a built-in way to get all the possible collection's fields without requesting all documents plugin will try:

  1. To return a manually filled queryFields - useful when some fields rarely appear
  2. To request 1000 documents and get all their unique fields, including nested

Golang driver

The mongo-go-driver contains four object types:

  • bson.D: A BSON document. This type should be used in situations where order matters, such as MongoDB commands
  • bson.M: An unordered map. It is the same as D, except it does not preserve order
  • bson.A: A BSON array
  • bson.E: A single element inside a D

TODO

  • Implement 'NOT BETWEEN' in SQL

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL