Steps to reproduce the problem.
In mongodb shell.
use test
db.items.save(
);
db.items.find();
db.refs.save( {name:"a", refval:{$ref:"items",$id:"4aae5217fc9d065d3cb6a7f3"}});
db.refs.find();
{"_id" : "4aae559ffc9d065d3cb6a7f4" , "name" : "a" , "refval" : {"$ref" : "items" , "$id" : "4aae5217fc9d065d3cb6a7f3"}}
exit
In command line then:
./mongoexport -d test -c refs -o ~/Desktop/mongoexporttest.json
./mongoimportjson --file ~/Desktop/mongoexporttest.json -d test -c newrefs
Results in following error:
connected to: 127.0.0.1
Mon Sep 14 16:41:50 Assertion: Invalid use of reserved field name
exception:massert:Invalid use of reserved field name
{ "_id" : "4aae559ffc9d065d3cb6a7f4", "name" : "a", "refval" :
}