-
Type: Bug
-
Resolution: Duplicate
-
Priority: Critical - P2
-
None
-
Affects Version/s: 1.6.3, 1.6.4, 1.6.5
-
Component/s: Index Maintenance, Querying, Usability
-
None
-
Environment:OSX, CentOS, Linux, 32 and 64 bit
-
ALL
I'm not sure how to describe this. So I made a gist.
https://gist.github.com/743921
If I run the query in question with only one object in the collection I get back two copies of the object.
Indexes
======
> db.system.indexes.find()
{ "name" : "id", "ns" : "t1d_development.users", "key" :
}
{ "name" : "email_1_encrypted_password_1", "ns" : "t1d_development.users", "key" :
, "unique" : true }
{ "name" : "memberships_1", "ns" : "t1d_development.users", "key" :
, "unique" : false }
{ "name" : "acl_fields.public_1", "ns" : "t1d_development.users", "key" :
, "unique" : false }
{ "name" : "acl_fields.value_1", "ns" : "t1d_development.users", "key" :
, "unique" : false }
{ "name" : "acl_fields.circles_1", "ns" : "t1d_development.users", "key" :
, "unique" : false }
Object
=====
db.users.findOne()
{
"_id" : ObjectId("4d0a54246a931656bc000006"),
"acl_fields" : [
,
,
,
,
,
,
,
,
{ "circles" : [ ], "name" : "date_of_birth", "public" : false, "value" : null, "_id" : ObjectId("4d0a62316a931656bc00000f"), "_type" : "AccessControlledFields::AclDateOfBirth" } ],
"confirmation_sent_at" : "Thu Dec 16 2010 12:02:12 GMT-0600 (CST)",
"confirmation_token" : null,
"confirmed_at" : "Thu Dec 16 2010 12:03:20 GMT-0600 (CST)",
"connections_circle_of_trust" :
,
"created_at" : "Thu Dec 16 2010 12:02:12 GMT-0600 (CST)",
"current_sign_in_at" : "Thu Dec 16 2010 12:03:20 GMT-0600 (CST)",
"current_sign_in_ip" : "127.0.0.1",
"email" : "amos@amos.com",
"encrypted_password" : "$2a$10$/dgVQhHdIYjSJa6yz6RWbezcuVjzwT1rj70PpybwjzN56i8X8.aBu",
"first_name" : "Amos",
"gender" : "Male",
"last_name" : "",
"last_sign_in_at" : "Thu Dec 16 2010 12:03:20 GMT-0600 (CST)",
"last_sign_in_ip" : "127.0.0.1",
"memberships" : [ ],
"middle_name" : "",
"nickname" : "aking",
"password_salt" : "$2a$10$/dgVQhHdIYjSJa6yz6RWbe",
"race_ethnicity" : [ ],
"sign_in_count" : 1,
"terms_acceptance" : "1",
"updated_at" : "Thu Dec 16 2010 13:02:09 GMT-0600 (CST)",
"zip_code" : ""
}
Query
=====
db.users.find({$or:[
{acl_fields:{$elemMatch:{name:{$ne:"gender"}, circles:{$in:[]}, value : /aking/i}}},
{acl_fields:{$elemMatch:{name:"gender", circles:{$in:[]}, value : /^aking$/i}}},
{acl_fields:{$elemMatch:
}},
{acl_fields:{$elemMatch:{name:{$ne:"gender"}, public:true, value:/aking/i}}}]})
- depends on
-
SERVER-2245 $or deduping should use IndexSpec getKeys
- Closed