Open johachi opened 9 months ago
Hi @johachi, sorry for the late answer.
It does look related to #153: here it looks like the query doesn't match anything when the source
fields aren't correctly ordered. For example, this seems to always return correct results:
db.collection.find({
triggers: {
$elemMatch: {
"trigger": "sa",
"method": "liveness_check",
"source.service": "example",
"source.type": "project",
"source.identifier": "222222222222222222222222"
}
}
})
playground link: https://mongoplayground.net/p/dumvPYTFSN7
I still need to figure a proper solution to this though
Description
The DB sometimes randomly returns "no documents" when using
$elemMatch
in the match.Setup
Share link: https://mongoplayground.net/p/AylVo0AlDWF
Database type
bson
Database content
Query
Expected Result
Actual Result
Sometimes same as the expected result, sometimes
no document found