Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-294

mongoimportjson is only accepting strict json - fails when mongoexport generated file contains db refs

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.1.1
    • Affects Version/s: 1.0.0
    • Component/s: Tools
    • None
    • Environment:
      OS X 10.5.8

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

      }

            Assignee:
            mike Michael Dirolf
            Reporter:
            yulce Denis Justinek
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: