BugZero found this defect 62 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/18/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
https://jira.mongodb.org/browse/BF-32195 was caused by a partial unique index that includes this filter in an OR "$and" : [ { "obj.obj.obj.obj.obj.obj.num" : { "$type" : "long" } } ] This query results in differing unique index behavior on the two versions. db.fuzzer.runCommand({ "update" : "fuzzer", "updates" : [ { "q" : { }, "u" : [ { "$addFields" : { "obj.obj.obj.obj.obj.obj.num" : { "$mod" : [ NumberLong("314159265358979383"), 34928 ] } } } ], "multi" : true } ]}) The $mod on 7.0 produces a long (and so send every document in the collection to the index, resulting in a duplicate key error). On 7.3 / 8.0 it produces an int and does not result in a duplicate key error. https://jira.mongodb.org/browse/DEVPROD-5208 resolved a similar issue. Avoiding "$type" : "long" anywhere in a partial unique index's filter should resolve the issue.