This package has been deprecated

Author message:

please update to new errand worker components

errand-component-mongodb

0.0.5 • Public • Published

#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
    • when [find] is used with upsert pass [find] field to match on
    • when [find] is used with remove pass [find] key/value pair to match on - use {} to match all
  • parameters.data contains list of items

##Config

Add/change following details in your config file.

{
  "errand": {
    "errand-component-mongodb": {
      "host": "localhost",
      "port": "27017"
    }
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i errand-component-mongodb

Weekly Downloads

0

Version

0.0.5

License

none

Last publish

Collaborators

  • mattcam