MongoDB Find
Runs a MongoDB find() query and outputs each result document
Processing
For each input row, the step runs a find query using the specified query, projection, sort order, and limit and outputs each resulting document into the row stream.
Settings
Name | Type | Description |
---|---|---|
Query | ||
Connection |
dict |
The MongoDB connection to use. Evaluated for each input row |
Database |
string |
The database to use. Evaluated for each input row |
Collection |
string |
The collection to run the query against. Evaluated for each input row |
Query |
string or dict |
The find query to run. Set to Example:
Evaluated for each input row |
Projection |
string or dict |
The projection to use for the query. Set to Example:
Evaluated for each input row |
Sort |
string or dict |
The sort specification to use. Set to Example:
Evaluated for each input row |
Limit |
long |
The limit to use for the query. Set to Evaluated for each input row |
Processing | ||
Batch Size |
long |
The batch size to set. Set to Evaluated for each input row |
Allow Disk Use |
boolean |
Sets the allowDiskUse flag for the query. Evaluated for each input row |
Query, Projection, and Sort are interpreted as BSON documents when given as string, or BSON documents when given as dicts.
Values and BSON are converted as per the following table:
Value Type | Bson Type |
---|---|
boolean | bool |
long | int or long |
double | double |
decimal | decimal |
datetime | date |
string | string |
binary | binary |
list | array |
dict | object |
Dicts of the form {'$oid' string}
are converted to BSON ObjectIds and vice versa.
Function values cannot be converted to BSON.
Note:
Converting a dict to BSON generally results in an unspecified key order in the BSON object.
If the order of keys is important, you can supply a specially constructed dict of the form:
{
:__bson [
[key1, value1],
[key2, value2],
...
]
}
Such dicts are converted to a BSON object with the order of key-value pairs preserved:
{
key1: value1,
key2: value2,
...
}
You can use the BSON widget to generate such dicts in the UI.
Results
Name | Type | Description |
---|---|---|
record |
dict | A dict containing the current result record. |