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

mongoimport converts string _id's to ObjectIDs when importing from a json file

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Tools
    • None
    • 6/15 nightly, gentoo
    • ALL

    Description

      I have a json export file created from mongoimport 1.4.3 which has id's in the string format:

      { "_id": "1234abcd", ... }

      When I try to import this file, mongoimport 1.5.x will convert all the IDs to ObjectIDs. If I export the imported collection, I get:

      { "_id":

      { "$oid": "1234abcd"}

      , ...}

      The 1.4.x behavior is to keep the id's as strings if the json file's id's are strings.

      Attachments

        Activity

          People

            mathias@mongodb.com Mathias Stearn
            jch Jerry Cheung
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: