builtin.nosql.nosql.iov2.mongodb.MongoDbInput
¶
MongoDbInput¶
Get records from MongoDB database.
Examples: Simple find:
To find by ObjectID:
To find by ISODate: {
"input": {
"use": "nosql.iov2#MongoDbInput",
"database": "analytics",
"collection": "users",
"host": "mongodb://USER:PASSWORD@host",
"find": {
"my_date_column": {
"$date": "1985-04-12T23:20:50.52Z"
}
}
}
}
Aggregate: {
"input": {
"use": "nosql.iov2#MongoDbInput",
"database": "analytics",
"collection": "users",
"host": "mongodb://USER:PASSWORD@host",
"aggregate": [
{"$match": {
"updated_at": {
"$gte": {"$date": "2013-10-01T00:00:00.000Z"}},
{"$match": { "status": "A" } }
]
},
"output": {}
}
Upsert: {
"input": {
"use": "nosql.iov2#MongoDbInput",
"database": "analytics",
"collection": "users",
"host": "mongodb://USER:PASSWORD@host",
"find": {
"age": {"$gte": 18},
}
"upsert": {
"last_updated_isodate": {
"$gte": {
"$date": "2021-01-25T22:43:01.884000+00:00"}}}
},
"output": {}
}
Limit: {
"input": {
"use": "nosql.iov2#MongoDbInput",
"database": "analytics",
"collection": "pictures",
"host": "mongodb://USER:PASSWORD@host",
"find": {
"color": "red",
}
"limit": 3
},
"output": {}
}
|
|||
type |
object |
||
properties |
|||
|
Host |
||
MongoDB database host URL to connect to |
|||
type |
string |
||
maxLength |
65536 |
||
minLength |
1 |
||
format |
uri |
||
|
Database |
||
MongoDB database name to connect to |
|||
type |
string |
||
|
Credentials |
||
MongoDB database credentials to connect to the db |
|||
default |
|||
anyOf |
type |
object |
|
type |
string |
||
|
Collection |
||
MongoDB collection name records will be searched in |
|||
type |
string |
||
|
Find |
||
A JSON string to search records. |
|||
type |
object |
||
default |
|||
|
Aggregate |
||
A JSON string to aggregate records. |
|||
default |
|||
anyOf |
type |
object |
|
type |
array |
||
items |
|||
|
Upsert |
||
Upsert object to perform upsert on MongoDB. This can be a:
|
|||
anyOf |
type |
string |
|
type |
object |
||
|
Limit |
||
An integer that determines how many records to fetch from MongoDB |
|||
type |
integer |
||
exclusiveMinimum |
0 |
||
default |
0 |
||
|
Debug |
||
Determines if to log JSON queries sent to the MongoDB |
|||
type |
boolean |
||
default |
True |
||
|
Timestamp |
||
A timestamp when the store was last modified.This is populated automatically |
|||
type |
string |
||
format |
date-time |