MongoDB Find

MongoDB Find

Certified

Query documents from MongoDB

Executes find on a collection with optional projection, sort, skip, and limit. Filter/projection/sort accept BSON strings or maps rendered from Flow variables. Results are fetched in-memory by default or stored as Ion in internal storage when store is true.

yaml
type: io.kestra.plugin.mongodb.Find
yaml
id: mongodb_find
namespace: company.team

tasks:
  - id: find
    type: io.kestra.plugin.mongodb.Find
    connection:
      uri: "mongodb://root:example@localhost:27017/?authSource=admin"
    database: "my_database"
    collection: "my_collection"
    filter:
      _id:
        $oid: 60930c39a982931c20ef6cd6

Find documents in MongoDB based on a filter condition using MongoDB Query Language.

yaml
id: filter_mongodb
namespace: company.team

tasks:
  - id: filter
    type: io.kestra.plugin.mongodb.Find
    connection:
      uri: mongodb://host.docker.internal:27017/
    database: local
    collection: pokemon
    store: true
    filter:
      base_experience:
        $gt: 100
Properties

MongoDB collection

MongoDB connection properties

Definitions
uri*Requiredstring

Connection string to MongoDB server

URL format like mongodb://mongodb0.example.com: 27017

MongoDB database

Query filter

BSON string or map rendered before execution.

Limit

Maximum documents returned.

Reference (ref) of the pluginDefaults to apply to this task.

Projection

BSON string or map selecting fields to return.

Skip

Documents to skip before returning results.

Sort

BSON string or map defining sort order.

Defaultfalse

Store results

When true, writes results as Ion to internal storage; otherwise returns rows. Defaults to false.

Result rows

Present when store is false.

Rows fetched

Formaturi

Stored result URI

Internal storage URI when store is true.

Unitcount

Number of documents fetched from MongoDB