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.