[DOCS-8584] Comment on: "manual/reference/program/mongoexport.txt" Created: 12/Aug/16  Updated: 12/Aug/16  Resolved: 12/Aug/16

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Docs Collector User (Inactive) Assignee: Allison Reinheimer Moore
Resolution: Done Votes: 0
Labels: bite-sized, collector-298ba4e7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS Ubuntu 16.04 LTS

Location: https://docs.mongodb.com/manual/reference/program/mongoexport/
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36
Referrer: https://www.google.ru/
Screen Resolution: 1366 x 768


Issue Links:
Related
is related to TOOLS-1370 mongoexport --fields only exports fir... Closed
Participants:
Days since reply: 7 years, 26 weeks, 5 days ago
Story Points: 0.25

 Description   

Please add note that you have to use ' ' when writing what fields to export, it is not clear from this tutorial. Like this: mongoexport -d database -c collection -f 'field1, field2' .....



 Comments   
Comment by Githook User [ 12/Aug/16 ]

Author:

{u'username': u'schmalliso', u'name': u'Allison Moore', u'email': u'allison.moore@10gen.com'}

Message: DOCS-8584: further clarifies spaces in fields
Branch: master
https://github.com/mongodb/docs/commit/20f4006883a236707ea4c2f129e0b8652f33445d

Comment by Githook User [ 12/Aug/16 ]

Author:

{u'username': u'schmalliso', u'name': u'Allison Moore', u'email': u'allison.moore@10gen.com'}

Message: DOCS-8584: mongoexport --fields cannot have spaces between the items

Comment by Allison Reinheimer Moore [ 12/Aug/16 ]

Thanks for pointing out this ambiguity! If you wish to specify multiple fields, they need to be in a comma-separated list, with no spaces between the items, as in the following:

mongoexport --db example --collection restaurants --fields restaurant_id,name --out twofield.json

If you include a space and put the list in quotes, the operation will succeed, but it will only export the first item in the list. I'll confer with colleagues to see if this is an expected mongoexport behaviour.

I've updated the field reference to clarify that you should not include a space. Thanks again!

Generated at Thu Feb 08 07:56:35 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.