[SERVER-294] mongoimportjson is only accepting strict json - fails when mongoexport generated file contains db refs Created: 14/Sep/09  Updated: 12/Jul/16  Resolved: 15/Sep/09

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 1.0.0
Fix Version/s: 1.1.1

Type: Bug Priority: Minor - P4
Reporter: Denis Justinek Assignee: Michael Dirolf
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X 10.5.8


Participants:

 Description   

Steps to reproduce the problem.

In mongodb shell.

use test
db.items.save(

{a:"1"}

);
db.items.find();

{"_id" : "4aae5217fc9d065d3cb6a7f3" , "a" : "1"}

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" :

{ "$ref" : "items", "$id" : "4aae5217fc9d065d3cb6a7f3" }

}



 Comments   
Comment by Michael Dirolf [ 15/Sep/09 ]

should be resolved in master and tonight's nightly

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