-
Type: New Feature
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
2
-
1,472
Can't seem to eliminate _id from mongoexport with --fields.
Steps to reproduce:
$ mongoexport --version mongoexport version: r3.2.7 git version: 2214d4d6561574f962c1dc72fefce4fe11843023 cat foo.json {"_id":{"$oid":"57605d5dc3d5a2429db0bce8"},"signup":{"$date":"2010-07-31T14:17:27.000Z"},"points":990061,"name":"Nick"} {"_id":{"$oid":"57605d5dc3d5a2429db0bce9"},"signup":{"$date":"2010-06-02T00:21:35.000Z"},"points":291770,"name":"Ophelia"} {"_id":{"$oid":"57605d5dc3d5a2429db0bcea"},"signup":{"$date":"2008-03-28T07:43:53.000Z"},"points":232650,"name":"Nick"} $ mongoimport --drop -d test -c people foo.json 2016-06-14T16:30:26.683-0400 connected to: localhost 2016-06-14T16:30:26.684-0400 dropping: test.people 2016-06-14T16:30:26.849-0400 imported 3 documents $ mongoexport -d test -c people --fields "name,points" 2016-06-14T16:30:38.564-0400 connected to: localhost {"_id":{"$oid":"57605d5dc3d5a2429db0bcea"},"points":232650,"name":"Nick"} {"_id":{"$oid":"57605d5dc3d5a2429db0bce8"},"points":990061,"name":"Nick"} {"_id":{"$oid":"57605d5dc3d5a2429db0bce9"},"points":291770,"name":"Ophelia"}
Expected result would be for the _id to be eliminated. Not seeing a way around this.