Skip to main content

MongoDB Listener Plugin

The MongoDB listener plugin polls for records from a MongoDB collection and publishes them to 1Gateway. It allows you to run MongoDB queries to filter out documents and avoid retrieving duplicate data.

Prerequisites

  • Network access to the MongoDB database from which data is retrieved.

Configuration Parameters

Field nameSupported valuesDescriptionExample
Connection stringValid connection stringConnection string to the MongoDB database.mongodb://192.168.0.40:27017/?directConnection=true
Database nameAny stringName of the database to connect to.test
Collection nameAny stringName of the collection to extract data from.audit_data
Database userAny stringMongoDB user. Leave blank if authentication is not required.
Database passwordAny stringMongoDB user's password. Leave blank if authentication is not required.
QueryValid MongoDB queryQuery to be executed. The $value placeholder will be replaced with the value of a field in the last message from the last poll cycle or with a default value.{ "timestamp": { "$gt": { "$date" : "$value" } }}
Field parameter (optional)Any stringAn existing message field name. Its value will replace the $value placeholder in the query.timestamp/$date
Field default value (optional)Any stringStarting parameter value (must be valid).2022-12-15T08:20:16.702+00:00
ProjectionComma-separated listDetermines which fields from the result to select in the output. Leave blank to get all fields.action,status,objectname,objectid
SortComma-separated listDetermines the order of the results in the output. Leave blank for any sorting.{"timestamp": 1}
Message typeAny string1Gateway message type of the MongoDB records.MongoDBMessage
Polling interval (in seconds)IntegerRecommended interval in seconds for polling (e.g., 86400 for once a day).86400