Find Find

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:

List containing the fetched data.

Only populated if store parameter is set to false.

size

  • Type: integer
  • Required:

The number of rows fetched.

uri

  • Type: string
  • Required:
  • Format: uri

URI of the file containing the fetched results.

Only populated if store parameter is set to true.

Definitions

io.kestra.plugin.mongodb.MongoDbConnection

Properties

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

Connection string to MongoDB server.

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

Was this page helpful?