MongoDB

Version: 2.0.7

MongoDB is a free and open-source cross-platform document-oriented database.

Connect MongoDB with LogicHub

  1. Navigate to Automations > Integrations.
  2. Search for MongoDB.
  3. Click Details, then the + icon. Enter the required information in the following fields.
    • Label: Enter a connection name.
    • Reference Values: Define variables here to templatize integration connections and actions. For example, you can use https://www.{{hostname}}.com where, hostname is a variable defined in this input. For more information on how to add data, see 'Add Data' Input Type for Integrations.
    • Verify SSL: Select option to verify connecting server's SSL certificate (Default is Verify SSL Certificate).
    • Remote Agent: Run this integration using the LogicHub Remote Agent.
    • Server IP or Hostname for MongoDB: Enter server's IP or Hostname where MongoDB is installed and the instance is running.
    • Port number for MongoDB: Enter the port number for MongoDB instance.
    • Enter database name: Database name for MongoDB.
    • Enter collection name: Collection name for MongoDB.
    • Username: Username for MongoDB.
    • Password: Password for MongoDB.
  4. After you've entered all the details, click Connect.

Actions for MongoDB

Query MongoDB (Deprecated)

Submits the given query to MongoDB and retrieves the result.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input NameDescriptionRequired
Query for MongoDBEnter the query string for the find operation. If you want to project certain fields provide them as comma-separated strings.
Example: {"_id": "5"} or ip_address, _id
Required

Output

mongodb matched documents returned as multiple rows (uncorrelated).

  • has_error: True/False
  • error: message/null
  • other keys of mongodb document

Query MongoDB

Submits the given query to MongoDB and retrieves the result. Learn more on querying documents https://docs.mongodb.com/manual/tutorial/query-documents/

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input NameDescriptionRequired
Query for MongoDBEnter jinja-templated MongoDB query.
Examples:
{}
{"mongo_col":"{{col_value}}"}
{"mongo_col":"{{col_value}}"}, {"mongo_col": 1, "mongo_col1": 1, "mongo_col2": 1}
* Limit (Optional): Limit number of results returned by running the above MongoDB query. (Default is 1000 results)

Output

mongodb matched documents returned as multiple rows (correlated).

  • has_error: True/False
  • error: message/null
  • other keys of mongodb document
14261426

Aggregate

Performs an aggregate operation on MongoDB collections object.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input NameDescriptionRequired
PipelineEnter jinja-templated pipeline for the aggregate operation.
Example:
[{"$match": {}}, {"$project": {"{{field_column}}": 1}}, {"$sort": {"{{field_column}}": -1, "_id": -1}}]
Required
13921392

Output

mongodb matched documents returned as multiple rows (correlated).

  • has_error: True/False
  • error: message/null
  • other keys of mongodb document
14341434

© 2017-2021 LogicHub®. All Rights Reserved.