mongodb@1.0.6
Functions
- execute(operations) ⇒
Operation
Execute a sequence of operations. Wraps
@openfn/language-common/execute
, and prepends initial state for http.- connect(state) ⇒
State
Connects to a mongoDb instance
- disconnect(state) ⇒
State
Removes connection from the state.
- insertDocuments(params) ⇒
State
Inserts documents into a mongoDb collection
- findDocuments(params) ⇒
State
Find documents in a mongoDb collection
- updateDocument(params) ⇒
State
Updates document (optionally upserting) into a mongoDb collection
execute(operations) ⇒ Operation
Execute a sequence of operations.
Wraps @openfn/language-common/execute
, and prepends initial state for http.
Kind: global function
Param | Type | Description |
---|---|---|
operations | Operations | Operations to be performed. |
Example
execute(
insertDocuments(params),
findDocuments(params)
)(state)
connect(state) ⇒ State
Connects to a mongoDb instance
Kind: global function
Param | Type | Description |
---|---|---|
state | State | Runtime state. |
Example
connect(state)
disconnect(state) ⇒ State
Removes connection from the state.
Kind: global function
Param | Type |
---|---|
state | State |
Example
disconnect(state)
insertDocuments(params) ⇒ State
Inserts documents into a mongoDb collection
Kind: global function
Param | Type | Description |
---|---|---|
params | object | Configuration for mongo |
Example
insertDocuments({
database: 'str',
collection: 'kids',
documents: [1,2,3]
});
findDocuments(params) ⇒ State
Find documents in a mongoDb collection
Kind: global function
Param | Type | Description |
---|---|---|
params | object | Configuration for mongo |
Example
findDocuments({
database: 'str',
collection: 'cases',
query: {a:3}
});
updateDocument(params) ⇒ State
Updates document (optionally upserting) into a mongoDb collection
Kind: global function
Param | Type | Description |
---|---|---|
params | object | Configuration for mongo |
Example
updateDocuments({
database: 'str',
collection: 'animals',
filter: { type: 'fuzzy' },
changes: { kind: 'soft' },
options: { upsert: true }
});