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

bsondump prints empty arrays as empty hashes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.7.0
    • Affects Version/s: 1.6.0
    • Component/s: Tools
    • None
    • Environment:
      MacOS X 10.6.4, 64-bit
    • ALL

      Empty arrays become empty hashes; mongo shell and mongoexport handle this correctly:

      % mongo
      MongoDB shell version: 1.6.0
      connecting to: test
      > db.foo.insert(

      {x:1,y:[]}

      )
      > db.foo.find()

      { "_id" : ObjectId("4c63248429573d0a580e1bf0"), "x" : 1, "y" : [ ] }

      % mongoexport -d test -c foo
      connected to: 127.0.0.1
      { "_id" :

      { "$oid" : "4c63248429573d0a580e1bf0" }

      , "x" : 1, "y" : [] }
      exported 1 records

      % mongodump -d test -c foo
      connected to: 127.0.0.1
      DATABASE: test to dump/test
      test.foo to dump/test/foo.bson
      1 objects
      % bsondump dump/test/foo.bson
      connected to: 127.0.0.1
      { _id: ObjectId('4c63248429573d0a580e1bf0'), x: 1.0, y: {} }
      Wed Aug 11 15:31:14 1 objects found

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            jgreely J Greely
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: