...
BugZero found this defect 201 days ago.
When performing $search queries, if a query contains duplicate keys in one of the embedded objects, the DB will start process the query but give back inaccurate results. Instead it should detect these duplicate key situations and return an error.
ted.tuckman commented on Tue, 13 Aug 2024 17:15:00 +0000: Closing in favor of the linked cloud ticket
Execute this query against the sample_mflix.movies collection. { compound: { must: [{ text: { path: "fullplot", query: "werewolves" }, text: { path: "fullplot", query: "vampires" } }] }} Because the 2 different "text" entries are both attributes in the same doc, only one of them gets processed and the other ignored (in my testing the last one tends to win). But this format of query is never valid, and produces un-expected results from the DB. For comparison, the corrected query is this. { compound: { must: [{ text: { path: "fullplot", query: "werewolves" } }, { text: { path: "fullplot", query: "vampires" } }] }}