mongodb@2.1.7
This adaptor exports the following from common:
- alterState()
- dataPath()
- dataValue()
- each()
- field()
- fields()
- fn()
- fnIf()
- lastReferenceValue()
- merge()
- sourceValue()
Functions
findDocuments
findDocuments(params) ⇒ State
Find documents in a mongoDb collection
Param | Type | Description |
---|---|---|
params | object | Configuration for mongo |
Example
findDocuments({
database: 'str',
collection: 'cases',
query: {a:3}
});
insertDocuments
insertDocuments(params) ⇒ State
Inserts documents into a mongoDb collection
Param | Type | Description |
---|---|---|
params | object | Configuration for mongo |
Example
insertDocuments({
database: 'str',
collection: 'kids',
documents: [1,2,3]
});
updateDocument
updateDocument(params) ⇒ State
Updates document (optionally upserting) into a mongoDb collection
Param | Type | Description |
---|---|---|
params | object | Configuration for mongo |
Example
updateDocuments({
database: 'str',
collection: 'animals',
filter: { type: 'fuzzy' },
changes: { kind: 'soft' },
options: { upsert: true }
});