[SERVER-1620] bsondump prints empty arrays as empty hashes Created: 11/Aug/10  Updated: 12/Jul/16  Resolved: 16/Aug/10

Status: Closed
Project: Core Server
Component/s: Tools
Affects Version/s: 1.6.0
Fix Version/s: 1.7.0

Type: Bug Priority: Trivial - P5
Reporter: J Greely Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MacOS X 10.6.4, 64-bit


Operating System: ALL
Participants:

 Description   

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


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