2.1.1 • Published 7 years ago

@datafire/mongodb v2.1.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

@datafire/mongodb

Client library for MongoDB

Installation and Usage

npm install --save @datafire/mongodb
let mongodb = require('@datafire/mongodb').create({
  database: "",
  url: ""
});

mongodb.findOne({
  "collection": "",
  "query": {}
}).then(data => {
  console.log(data);
});

Description

Interact with MongoDB

Actions

findOne

Find a single document in the database

mongodb.findOne({
  "collection": "",
  "query": {}
}, context)

Input

  • input object
    • collection required string
    • query required object
    • projection object

Output

  • output object

find

Find multiple documents in the database

mongodb.find({
  "collection": "",
  "query": {}
}, context)

Input

  • input object
    • collection required string
    • query required object
    • projection object

Output

  • output array
    • items object

insertOne

Insert a document into the database

mongodb.insertOne({
  "collection": "",
  "document": {}
}, context)

Input

  • input object
    • collection required string
    • document required object

Output

  • output object

insertMany

Insert multiple documents into the database

mongodb.insertMany({
  "collection": "",
  "documents": []
}, context)

Input

  • input object
    • collection required string
    • documents required array
      • items object

Output

  • output object

update

Update all matching documents in the database

mongodb.update({
  "collection": "",
  "query": {},
  "update": {}
}, context)

Input

  • input object
    • collection required string
    • query required object
    • update required object

Output

  • output object

remove

Remove all matching documents in the database

mongodb.remove({
  "collection": "",
  "query": {}
}, context)

Input

  • input object
    • collection required string
    • query required object
    • justOne boolean

Output

  • output object

Definitions

This integration has no definitions