mongodb

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2019 License: BSD-3-Clause Imports: 7 Imported by: 0

README


title: MongoDB weight: 4622

MongoDB

This activity allows you to connect to a MongoDB server

Installation

Flogo CLI

flogo install github.com/TIBCOSoftware/flogo-contrib/activity/mongodb

Schema

Inputs and Outputs:

{
  "input": [
    {
      "name": "uri",
      "type": "string",
      "required": true
    },
    {
      "name": "dbName",
      "type": "string",
      "required": true
    },
    {
      "name": "collection",
      "type": "string",
      "required": true
    },
    {
      "name": "method",
      "type": "string",
      "allowed": [
        "DELETE",
        "INSERT",
        "REPLACE",
        "UPDATE"
      ],
      "value": "INSERT",
      "required": true
    },
    {
      "name": "keyName",
      "type": "string"
    },
    {
      "name": "keyValue",
      "type": "string"
    },
    {
      "name": "value",
      "type": "any"
    }
  ],
  "output": [
    {
      "name": "output",
      "type": "any"
    },
    {
      "name": "count",
      "type": "integer"
    }
  ]
 }

Settings

Setting Required Description
uri True The MongoDB connection URI
dbName True The name of the database
collection True The collection to work on
method True The method type (DELETE, INSERT, UPDATE or REPLACE). This field defaults to INSERT
keyName False The name of the key to use when looking up an object (used in DELETE, UPDATE, and REPLACE)
keyValue False The value of the key to use when looking up an object (used in DELETE, UPDATE, and REPLACE)
value False The value of the object (used in INSERT, UPDATE, and REPLACE)

Example

The below example is for an insert into MongoDB

{
  "id": "MongoDB_1",
  "name": "MongoDB connector",
  "description": "Insert MongoDB documents in a specified collection",
  "activity": {
    "ref": "github.com/TIBCOSoftware/flogo-contrib/activity/mongodb",
    "input": {
      "uri": "mongodb://localhost:27017",
      "dbName": "mydb",
      "collection": "users",
      "method": "INSERT",
      "value": {"name":"theuser"}
    }
  }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewActivity

func NewActivity(metadata *activity.Metadata) activity.Activity

NewActivity creates a new AppActivity

Types

type MongoDbActivity

type MongoDbActivity struct {
	// contains filtered or unexported fields
}

Integration with MongoDb inputs: {uri, dbName, collection, method, [keyName, keyValue, value]} outputs: {output, count}

func (*MongoDbActivity) Eval

func (a *MongoDbActivity) Eval(ctx activity.Context) (done bool, err error)

Eval implements api.Activity.Eval - MongoDb integration

func (*MongoDbActivity) Metadata

func (a *MongoDbActivity) Metadata() *activity.Metadata

Metadata returns the activity's metadata

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL