Skip to content

MongoDB

Browse implementations

Target Configuration

For all actions, the target should have a property databaseName

Mongo target example
1
2
3
4
5
6
7
8
9
{
    "name": "mongo_target",
    "url": "mongo://my.mongo.base:27017",
    "properties": {
        "databaseName": "myDatabaseName",
        "username": "myUsername", // (1)
        "password": "myPassword" // (2)
    }
}
  1. Valid properties are username or user. Set this for basic authentication
  2. Valid properties are userPassword or password. Set this for basic authentication

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🔗

!!! info Browse implementations

Required Name Type Default
* target String
* collection String
* query String
Name Type
count long

Example🔗

1
2
3
4
5
MongoCountAction(
    target = "mongo_target",
    collection = "ghibli_movies",
    query = "{ rating: { \$gt: 85 } }"
)

Delete🔗

!!! info Browse implementations

Required Name Type Default
* target String
* collection String
* query String
Name Type
deletedCount long

Example🔗

1
2
3
4
5
MongoDeleteAction(
    target = "mongo_target",
    collection = "ghibli_movies",
    query = "{ director: { \"Hayao Miyazaki\" } }"
)

Find🔗

!!! info Browse implementations

Required Name Type Default
* target String
* collection String
* query String
limit Integer 20
Name Type
documents List<String>

Example🔗

1
2
3
4
5
6
MongoFindAction(
    target = "mongo_target",
    collection = "ghibli_movies",
    query = "{ director: { \"Hayao Miyazaki\" } }",
    limit = 42
)

Insert🔗

!!! info Browse implementations

Required Name Type Default
* target String
* collection String
* document String

Insert action does not have output.

Example🔗

1
2
3
4
5
MongoInsertAction(
    target = "mongo_target",
    collection = "ghibli_movies",
    document = "{ title: \"Pom Poko\", director: \"Isao Takahata\", rating: 77 }"
)

List Collections🔗

!!! info Browse implementations

Required Name Type Default
* target String
Name Type
collectionNames List<String>

Example🔗

1
2
3
MongoListAction(
    target = "mongo_target"
)

Update🔗

!!! info Browse implementations

Required Name Type Default
* target String
* collection String
* filter String
* update String
arrayFilters List<String>

Note

ArrayFilters are supported since MongoDB v3.5.12+ (https://jira.mongodb.org/browse/SERVER-831)

Name Type
modifiedCount long

Example🔗

1
2
3
4
5
6
MongoUpdateAction(
    target = "mongo_target",
    collection = "ghibli_movies",
    filter = "{ director: { \"Hayao Miyazaki\" } }",
    update = "{ director: { \"Saburō Akitsu\" } }"
)