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

[MongoDB I/O] Export doesn't write things to stdout #210

Closed
Tracked by #216
surister opened this issue Aug 2, 2024 · 3 comments
Closed
Tracked by #216

[MongoDB I/O] Export doesn't write things to stdout #210

surister opened this issue Aug 2, 2024 · 3 comments

Comments

@surister
Copy link
Contributor

surister commented Aug 2, 2024

In

file = file or sys.stdout.buffer
we have default sys.stdout.buffer but the only usage in
collection_to_json(db[args.collection], file=buffer)
we pass a BytesIO object, so in reality we never throw the documents to the stdout.

Meaning that as per explained in https://cratedb-toolkit.readthedocs.io/io/mongodb/migr8.html, we cannot migr8 export ... > data.json

If we dummy fix this, we still get the header in the file, any tool taking advantage of this should take this into consideration.

image

@surister
Copy link
Contributor Author

surister commented Aug 2, 2024

In fact, the first info line breaks the integration with cr8 insert-json, if we eliminate it it works, for simple documents.
image

@amotl
Copy link
Member

amotl commented Aug 2, 2024

Thank you. Maybe this bug has been introduced while wrapping migr8 into ctk load table. We planned a documentation update, see:

But also, if there is a bug in migr8 about the issue you are observing, we should fix it.

@amotl amotl changed the title MongoDB export doesn't write things to stdout. [MongoDB I/O] Export doesn't write things to stdout Aug 6, 2024
@amotl
Copy link
Member

amotl commented Aug 19, 2024

Hi. I think this problem has been addressed with the recently landed bugfix and improvement patch, so I am closing this.

Thank you very much for your report, and please re-open if you think the problem still exists. Otherwise, please enjoy the fixed package. 🙏

@amotl amotl closed this as completed Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants