Configuration
Example configuration in a processor:
{
"name" : "MongoDB Hydrator",
"active" : true,
"type" : "mongo-hydrator",
"servers": [
{
"host": "localhost",
"port": 8080
}
],
"url": "mongo+srv://cluster0.qwerty.mongodb.net/myDatabase.myCollection",
"tls": false,
"db": "database_name",
"collection": "collection_name",
"transactions": false,
"strict": false
}
Configuration parameters:
servers.host
(Required*
, String) The host(s) where the instance of the MongoDB is located
servers.port
(Required*
, Integer) The port(s) on which MongoDB is running
url
(Required*
, String) A MongoDB connection url, optionally containing the database and collection names.
*
Only one connection method (either servers
or url
is required. If both are given, the url
takes precedence)
tls
(Optional, Boolean) Whether tls should be enabled. Defaults to false
unless a Mongo Atlas url (mongo+srv://
) is used
in which case the default is true
db
(Required*
, String) The name of the MongoDB database to hydrate to
collection
(Required*
, String) The name of the MongoDB collection to hydrate to
*
The database name (db
) and collection name (collection
) need not be explicitly defined if they
are included in the url
parameter
transactions
(Optional, Boolean) Whether details of the transactions (database name, collection, identifier and action)
should be written to a separate collection. Defaults to false
strict
(Optional, Boolean) Whether to strictly enforce inserts and updates (and fail in the case an inserted id already
exists, or an updated id doesn't already exist) or to use upserts (where an insert of an existing id or an
update to a non-existent id will succeed). Defaults to false