yaml
type: "io.kestra.plugin.mongodb.Find"

Find documents from a MongoDB collection.

Examples

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

Properties

collection

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

MongoDB collection.

connection

MongoDB connection properties.

database

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

MongoDB database.

filter

  • Type: object
  • Dynamic: ✔️
  • Required:

MongoDB BSON filter.

Can be a BSON string, or a map.

limit

  • Type: integer
  • Dynamic: ✔️
  • Required:

The number of records to return.

projection

  • Type: object
  • Dynamic: ✔️
  • Required:

MongoDB BSON projection.

Can be a BSON string, or a map.

skip

  • Type: integer
  • Dynamic: ✔️
  • Required:

The number of records to skip.

sort

  • Type: object
  • Dynamic: ✔️
  • Required:

MongoDB BSON sort.

Can be a BSON string, or a map.

store

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: false

Whether to store the data from the query result into an ion serialized data file.

Outputs

rows

  • Type: array
  • SubType:
  • Required:

size

  • Type: integer
  • Required:

uri

  • Type: string
  • Required:
  • Format: uri

Definitions

io.kestra.plugin.mongodb.MongoDbConnection

  • uri
    • Type: string
    • Dynamic: ✔️
    • Required: ✔️
    • Min length: 1