|
Hello itzikkg,
Thank you for the report. Looking over the behavior described, I believe this behavior is due to the same underlying cause as the behavior described in SERVER-5580 where the index is not marked as multikey when all arrays are singletons, so I've closed this ticket as a duplicate. Fortunately, this is fixed in the upcoming version 3.6 release, which I verified on 3.6.0-rc3 with the dataset you provided:
> db.appTasks.find({ "taskState" : 1, "isFolderLocking" : true, "affectedFolders" : { "$in" : [NumberLong("1000000000000114891")] } },{"affectedFolders":1, "_id":0})
|
{ "affectedFolders" : [ NumberLong("1000000000000114891") ] }
|
> db.appTasks.createIndex({"taskState":1, "isFolderLocking":1, "affectedFolders":1})
|
{
|
"createdCollectionAutomatically" : false,
|
"numIndexesBefore" : 1,
|
"numIndexesAfter" : 2,
|
"ok" : 1
|
}
|
> db.appTasks.find({ "taskState" : 1, "isFolderLocking" : true, "affectedFolders" : { "$in" : [NumberLong("1000000000000114891")] } },{"affectedFolders":1, "_id":0})
|
{ "affectedFolders" : [ NumberLong("1000000000000114891") ] }
|
Thanks,
Mark
|