> BSON doesn't specifically disallow it, but most languages don't
> support it. C++ and C do, but languages that implement documents as
> hashes can't. Even if you saved a doc with duplicate keys in C/C++,
> you wouldn't be able to see them in the shell. And querying for it
> would be kind of wacky. So, generally don't do that.
> Is there a reason you can't do tuple:["value", "value", "different
> value"]?
> On Wednesday, August 22, 2012 7:50:23 PM UTC-4, Russell Bateman wrote:
> Is there no way in Mongo to get a document that looks like the one
> I'm trying to insert here?
> > db.subs.insert( { "x":9, "tuple":"value", "tuple":"value",
> "tuple":"different value" } );
> > db.subs.findOne();
> {
> "_id" : ObjectId("50356db633f95e308785e7d4"),
> "x" : 9,
> "tuple" : "different value"
> }
> > db.subs.insert( { "x":9, "data": { "tuple":"value",
> "tuple":"value", "tuple":"different value" } } );
> > db.subs.findOne();
> {
> "_id" : ObjectId("50356db633f95e308785e7d5"),
> "x" : 9,
> "data" : {
> "tuple" : "different value"
> }
> }
> Note that the first two tuples were ignored/dropped/overwritten,
> and not just because they had the same value. I'm not totally
> surprised by this, but I wondered. Certainly it's the case in the
> Java driver, in BasicDBObject, that stuff is done in a Map which
> doesn't allow multiple identical keys so it's doubtful I could get
> anything back anyway.
> Would someone like to growl at me or discuss this? If it worked, I
> could make use of it and in fact had been blithely writing code as
> if it worked until a little while later noticing that it did not.
> Many thanks.
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongodb-user@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user+unsubscribe@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb