[DOCS-8817] mongoimport process sends everything to stderr Created: 14/Sep/16 Updated: 03/Nov/17 Resolved: 29/Sep/16 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | drivers |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Docs Collector User (Inactive) | Assignee: | Steve Renaker (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
osx yosemite 10.10.5 Location: https://docs.mongodb.com/manual/reference/program/mongoimport/ |
||
| Participants: | |
| Days since reply: | 7 years, 21 weeks, 5 days ago |
| Description |
|
Hello - I am trying to run mongoimport inside some ruby code, and determine if the import succeeded or failed. Unfortunately, it seems that mongoimport always sends to stderr, instead of stdout for success and stderr for failures. This is my code - let me know if I'm mis-using, or if this is a bug! Thanks, def import_csv command = "mongoimport --db learnup --collection # {@file_name}--type csv --headerline --file # {@file_path}" Open3.popen3(command) do |stdin, stdout, stderr, wait_thr| puts "stdout is: " + standard_out
|
| Comments |
| Comment by Steve Renaker (Inactive) [ 16/Sep/16 ] |
|
jacindaz@gmail.com Hi Jacinda, This forum is generally only for requests related to the documentation project. I would suggest you look for help at the MongoDB Google Group (https://groups.google.com/forum/#!forum/mongodb-user) and cite this ticket for further clarification or support. Best regards,
|
| Comment by Jacinda Zhong [ 16/Sep/16 ] |
|
Thanks Steve - can you explain exactly which messages go to STDOUT, from which other tools, and why this decision was made? |
| Comment by Steve Renaker (Inactive) [ 16/Sep/16 ] |
|
jacindaz@gmail.com Hi Jacinda, All the MongoDB command line tools send status messages to STDERR, and use STDOUT for other kinds of output. If you'd like to check the success or failure of a shell command, you can check the exit code ($? in Ruby – there's a good description here: https://gist.github.com/defunkt/326968). Thanks and best regards,
|
| Comment by Steve Renaker (Inactive) [ 15/Sep/16 ] |
|
jacindaz@gmail.com Hi Jacinda, thanks for filing this ticket. We're looking into the issue, and I'll let you know as soon as there's something to report. Best regards,
|
| Comment by Jacinda Zhong [ 15/Sep/16 ] |
|
Hello - I just created a jira account for mongo, I'm the original reporter. Let me know if you have other questions/thoughts about this ticket! |