[SERVER-3117] mongoimport should move _id to front of object Created: 18/May/11  Updated: 12/Jul/16  Resolved: 27/Jul/14

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: None
Fix Version/s: 2.6.0

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Unassigned
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour

Participants:

 Description   

output from languages like python is unlikely to have it in front.



 Comments   
Comment by Asya Kamsky [ 27/Jul/14 ]

This seems to always happen, probably as a result of update/validation re-write.

cat /tmp/id.json
{__v:0,_id:1,string:"foo1"}
{__v:0,_id:2,string:"foo2"}
{__v:0,_id:3,string:"foo3"}
mongoimport -d test -c whereisid < /tmp/id.json
connected to: 127.0.0.1
2014-07-27T13:01:10.381-0700 imported 3 objects
Asyas-MacBook-Pro:Logs asya$ mongo test --eval 'printjson(db.whereisid.find().toArray())'
MongoDB shell version: 2.6.1
connecting to: test
[
	{
		"_id" : 1,
		"__v" : 0,
		"string" : "foo1"
	},
	{
		"_id" : 2,
		"__v" : 0,
		"string" : "foo2"
	},
	{
		"_id" : 3,
		"__v" : 0,
		"string" : "foo3"
	}
]

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