MongoDB Commands

MongoDB commands are required to have one of the following forms (see below). They are structured in JSON notation and are required to have the field find.

// variant 1
{ find:"<query>", <filter> ... }
 
// variant 2
{ find:"<query>", filter: { ... } }
  • Variant 1: a JSON object with each key (except find) being a field name from the find-query and the value being filter expression
  • Variant 2: a JSON object with a key find and a key filter - which is a filter expressions.

You can check the Filter Projection syntax from the MongoDB manual.

The <query> of the find command also has two variants:

  • database.collection: ignore the database in the datasource URI
  • collection: use the database from the datasource URI

Example

Filter for an event in the collection persistence.eventlog-system

// variant 1
{ find: "persistence.eventlog-system", event:"CreateResource" }
 
 
// variant 2
{ find: "persistence.eventlog-system",
  filter: {
    event: "CreateResource"
  }
}