[SERVER-7601] Can create document with multiple instances of one key and console doesn't understand it Created: 09/Nov/12  Updated: 15/Feb/13  Resolved: 13/Nov/12

Status: Closed
Project: Core Server
Component/s: Networking, Shell
Affects Version/s: 2.0.3
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Max Lapshin Assignee: hari.khalsa@10gen.com
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.7
emongo https://github.com/master/emongo/commit/d858fa1757b47c919f88b7d96057bad0075ed731


Operating System: ALL
Participants:

 Description   

I create document via emongo driver:

emongo:insert(database, "my_collection", [

{x,4}

,

{x,1}

,

{x,3}

]).

Now I select it:

emongo:find_all(database, "my_collection").

[[{<<"_id">>,
{oid,<<80,156,252,176,8,197,245,106,230,82,14,180>>}},

{<<"x">>,4}

,

{<<"x">>,1}

,

{<<"x">>,3}

]]

Now I go to console:

mongo database
> > db.t.find()

{ "_id" : ObjectId("509cfcb008c5f56ae6520eb4"), "x" : 4, "x" : 4, "x" : 4 }

I see here two problems:
1) I can store document with many instances of key and search is done only via first instance of key
2) mongo console doesn't understand it and looses other values for this key



 Comments   
Comment by hari.khalsa@10gen.com [ 13/Nov/12 ]

Hi! Please see this link:
https://groups.google.com/d/topic/mongodb-user/Y9kwLOFSUH8/discussion

Summary: having several instances of one key is not dealt with gracefully by everybody and is best avoided.

Comment by Max Lapshin [ 13/Nov/12 ]

Can I help somehow?

Generated at Thu Feb 08 03:15:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.