0.0.5 • Published 9 years ago
errand-component-mongodb v0.0.5
#errand-component-mongodb
errand task for working with mongodb
errand-component-mongodb is an errand component that is used to work with mongodb.
##Usage:
Example of how to use errand-component-mongodb in errand task list follows.
{
"tasks":
[
{
"description": "task to insert a list into a collection",
"task": "errand-component-mongodb",
"parameters":
{
"config": "default.json",
"method": "upsert",
"database": "test",
"collection": "test",
"data": [{"foo": "bar"}],
"find": ""
}
}
]
}
Where:
- description describes task
- task is the name of task
- parameters.config filename of config file
- parameters.method instruction for task, options:
- insert insert data into collection
- upsert upsert data using find into collection - where find matches then upsert otherwise insert
- remove remove find from collection - use remove to delete data
- parameters.database database to use
- parameters.collection collection to use
- parameters.method instruction for task, options:
- parameters.find used with remove and upsert to match documents in collections
- parameters.data contains list of items
##Config
Add/change following details in your config file.
{
"errand": {
"errand-component-mongodb": {
"host": "localhost",
"port": "27017"
}
}
}