Skip to main content
MongoDB

MongoDB - Find multiple documents

MongoDB - Find multiple documents

Finds several documents in a MongoDB collection by applying a search filter. The returned documents can be iterated with MongoDB: For each document.


Options

Collection

Reference to the MongoDB: Select collection action the search will run on.

Filter (query)

Search filter in MongoDB document format, for example { "status": "ativo" }. Leave it empty or pass {} to return every document.

Transaction (optional)

Reference to a MongoDB: Start transaction action when the operation must run inside a transaction. Optional field, available under the advanced options.

Returns

Javascript code

js
actions["action-id"].documents // cursor with the documents found (Any)
actions["action-id"].count // number of documents found (Number)

Field selection

  • documents — cursor with the returned documents, used by MongoDB: For each document (Any)
  • count — number of documents found (Number)

Rules and Conditions

  • The Collection and Filter fields are required.
  • The filter must be a valid JSON document in MongoDB format.
  • To iterate over the returned documents, use the MongoDB: For each document action.