You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MongoDB wire: a filter on a null-valued field never matches, because it compiles to "= :param" instead of IS NULL #6952
Found while fixing #6941 (upsert-by-_id duplicate creation). MongoDBToSqlTranslator.buildExpression translates any scalar filter value, including null, into "field" = :param with the parameter bound to null:
An equality comparison against a bound null parameter does not match a stored null (or absent) property the way SQL's IS NULL does. So any Mongo filter of the shape {field: null} - a legal and not-uncommon query, since MongoDB's null-equality semantics also match a genuinely missing field - matches nothing in find, update, and delete, regardless of what's actually stored.
Repro
collection.updateOne(eq("_id", null), newDocument("$set", newDocument("v", 1)), newUpdateOptions().upsert(true));
// creates a document with _id: nullcollection.updateOne(eq("_id", null), newDocument("$set", newDocument("v", 2)), newUpdateOptions().upsert(true));
// does NOT find the document just created; upserts a second one instead
Same gap applies to find(eq("anyField", null)) and deleteOne/deleteMany on a null-valued filter - not specific to _id or to upsert.
Suggested fix
In buildExpression (and the $eq handling that shares the same buildValue call), special-case a null value to emit "field" IS NULL instead of "field" = :param, matching MongoDB's actual null/missing-field semantics as closely as the engine's IS NULL allows.
Scope / confidence
Medium-high on the mechanism (verified buildValue/buildExpression never special-case null, and reproduced the non-match empirically), but the fix touches filter translation shared by find/update/delete/$eq, so it deserves its own review and test pass rather than being folded into the unrelated #6941 upsert fix.
A query filter on a null value (e.g. `{field: null}`) now correctly matches documents where that field is null or missing, instead of matching nothing. This fixes `find`, `update`, `delete`, and also makes a repeated upsert filtered by a null `_id` idempotent.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
Activity
fix: address review on #6941 - avoid discarding an explicit null _id,…
Merge pull request #6969 from ArcadeData/fix/6952-6953-6955-mongodb-b…
lvca commentedon Sep 1, 2026
Fixed in #6969.
A query filter on a null value (e.g. `{field: null}`) now correctly matches documents where that field is null or missing, instead of matching nothing. This fixes `find`, `update`, `delete`, and also makes a repeated upsert filtered by a null `_id` idempotent.
❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.
fix(ArcadeData#6952,ArcadeData#6953): null-filter IS NULL translation…