Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No example input file provided - Unable to run task with Bulk command #3

Open
shrutimantri opened this issue Jan 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shrutimantri
Copy link
Contributor

Expected Behavior

Successfully running the example given here: https://kestra.io/plugins/tasks/io.kestra.plugin.mongodb.Bulk

Actual Behaviour

The flow example of type: "io.kestra.plugin.mongodb.Bulk"mentioned in this page uses an input file in this line: from: "{{ inputs.file }}"

But it is not clear exactly what this file should contain. It is unclear as to how to represent the operations and the command in this file. Without this information, I am unable to run this exanmple.

Note: The other MongoDB commands where input file is required is a json file containing the documents. But this one is a special case as we also need to put in the operation details along with the document.

Steps To Reproduce

Trying to run the flow example:

id: "bulk"
type: "io.kestra.plugin.mongodb.Bulk"
connection:
  uri: "mongodb://root:example@localhost:27017/?authSource=admin"
database: "my_database"
collection: "my_collection"
from: "{{ inputs.file }}"

Environment Information

  • Kestra Version: 0.14.0
  • Plugin version: 0.14.0
  • Operating System (OS / Docker / Kubernetes): Docker
  • Java Version (If not docker): N/A

Example flow

id: "bulk"
type: "io.kestra.plugin.mongodb.Bulk"
connection:
  uri: "mongodb://root:example@localhost:27017/?authSource=admin"
database: "my_database"
collection: "my_collection"
from: "{{ inputs.file }}"
@shrutimantri shrutimantri added the bug Something isn't working label Jan 27, 2024
@anna-geller anna-geller added this to the v0.18.0 milestone Jan 28, 2024
@cedrelek
Copy link

cedrelek commented Apr 5, 2024

The file must have bulk operations, as explained here : https://www.mongodb.com/docs/manual/reference/method/db.collection.bulkWrite/

For exemple a ion file (do not start the file with an array symbol "[") :

{ "insertOne" : { "document" : "<document>" } }
{ "updateOne" : {
  "filter": "<document>",
  "update": "<document or pipeline>",
  "upsert": "<boolean>",
  "collation": "<document>",               
  "arrayFilters": [ "<filterdocument1>" ],
  "hint": "<document/string>"    
  }
}

@wrussell1999 wrussell1999 changed the title Unable to run task with Bulk command No example input file provided - Unable to run task with Bulk command May 3, 2024
@github-project-automation github-project-automation bot moved this to Backlog in Issues Jun 10, 2024
@anna-geller anna-geller removed this from the v0.18.0 milestone Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants