Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
None
-
None
-
None
-
ALL
Description
I found many closed issues about multikeys index bounds but I can't find an opened one for the 3.6.13
Regarding this index :
{
|
"activities.metadatas.joinValue" : 1, |
"activities.metadatas.joinStart" : 1, |
"activities.metadatas.joinEnd" : 1 |
}
|
And this query :
{'activities.metadatas': {'$elemMatch':{ |
'joinValue':'4559157', |
"joinStart": { "$gte": ISODate("2019-10-29T10:29:24.860Z"), |
"$lt": ISODate("2019-10-29T10:29:26.870Z") }}} |
}
|
Then the query planner uses the previous index with theses bounds :
{
|
"activities.metadatas.joinValue": [ |
"[\"4559157\", \"4559157\"]" |
],
|
"activities.metadatas.joinStart": [ |
"[new Date(1572344964860), new Date(1572344966870))" |
],
|
"activities.metadatas.joinEnd": [ |
"[MinKey, MaxKey]" |
]
|
}
|
==> OK
Now with this query variant
{'activities':{'$elemMatch':{'metadatas': {'$elemMatch':{ |
'joinValue':'4559157','name': 'customer_id', |
"joinStart": { |
"$gte": ISODate("2019-10-29T10:29:24.860Z"), |
"$lt": ISODate("2019-10-29T10:29:26.870Z") |
}}}}}}
|
Then the bounds are :
{
|
"activities.metadatas.joinValue": [ "[\"4559157\", \"4559157\"]" ], "activities.metadatas.joinStart": [ "[MinKey, MaxKey]" ], "activities.metadatas.joinEnd": [ "[MinKey, MaxKey]" ] |
}
|
=> timeout..