MongoDB
Browse implementations
Target Configuration
For all actions, the target should have a property databaseName
.
Mongo connection string options must be prefixed with connectionOptions.
basic auth example x509 auth example
{
"name" : "mongo_target" ,
"url" : "mongo://my.mongo.base:27017" ,
"properties" : {
"databaseName" : "myDatabaseName" ,
"username" : "myUsername" , // (1)
"password" : "myPassword" // (2)
"connectionOptions.appName" : "chutney"
}
}
Valid properties are username
or user
. Set this for basic authentication
Valid properties are userPassword
or password
. Set this for basic authentication
{
"name" : "mongo_target" ,
"url" : "mongo://my.mongo.base:27017" ,
"properties" : {
"databaseName" : "myDatabaseName" ,
"connectionOptions.appName" : "chutney"
"connectionOptions.authMechanism" : "MONGODB-X509"
"keyStore" : "path/to/keystore" , // (1)
"keyStorePassword" : "keystore.password" ,
"trustStore" : "path/to/truststore" ,
"trustStorePassword" : "truststore.password" ,
}
}
This automatically enable ssl connection (no need to do connectionOptions.ssl=true
)
Collection Example
ghibli_movies {
"title" : "Castle in the Sky" ,
"director" : "Hayao Miyazaki" ,
"rating" : 78
}
{
"title" : "Grave of the Fireflies" ,
"director" : "Isao Takahata" ,
"rating" : 94
}
{
"title" : "My Neighbor Totoro" ,
"director" : "Hayao Miyazaki" ,
"rating" : 86
}
Count
Example
MongoCountAction (
target = "mongo_target" ,
collection = "ghibli_movies" ,
query = "{ rating: { \ $ gt : 85 } }"
)
Delete
Example
MongoDeleteAction (
target = "mongo_target" ,
collection = "ghibli_movies" ,
query = "{ director: { \"Hayao Miyazaki\" } }"
)
Find
Example
MongoFindAction (
target = "mongo_target" ,
collection = "ghibli_movies" ,
query = "{ director: { \"Hayao Miyazaki\" } }" ,
limit = 42
)
Insert
Insert action does not have output.
Example
MongoInsertAction (
target = "mongo_target" ,
collection = "ghibli_movies" ,
document = "{ title: \"Pom Poko\", director: \"Isao Takahata\", rating: 77 }"
)
List Collections
Example
MongoListAction (
target = "mongo_target"
)
Update
Example
MongoUpdateAction (
target = "mongo_target" ,
collection = "ghibli_movies" ,
filter = "{ director: { \"Hayao Miyazaki\" } }" ,
update = "{ director: { \"Saburō Akitsu\" } }"
)