Repository navigation
fix: covers edge case interpretation in js runtime - #96
Merged
Merged
Conversation
stalniy
force-pushed
the
fix/ucast-edge-cases
branch
2 times, most recently
from
November 2, 2026 10:12
db8a93f to
ee7d4c1
Compare
stalniy
force-pushed
the
fix/ucast-edge-cases
branch
2 times, most recently
from
November 2, 2026 10:55
cca943c to
8f950f0
Compare
BREAKING CHANGE: query matching and comparator result types change in
@ucast/js and @ucast/mongo2js:
- Ordering operators reject incompatible types by default instead of using
JavaScript coercion. For example, { a: '2' } no longer matches
{ a: { $lt: 10 } }. Raw @ucast/js Date/number comparisons also stop
matching; @ucast/mongo2js still normalizes Dates to numeric timestamps.
- Ordering operators always return false when either operand is undefined,
including missing fields, without calling custom comparators. Selecting
the legacy compare function does not restore this behavior.
- eq(ITSELF, null) now matches null and [null], and no longer matches {},
[{}], or [[null]]. The corresponding ne results change inversely.
- Projected exists(false) now requires every array element to lack the
property. Mixed present/missing arrays stop matching, while empty arrays
start matching.
- exists(ITSELF, false) now returns false for defined inputs and true for
undefined, reversing its previous results.
- Array projection skips null and undefined elements before calling custom
getters, so getters can no longer supply values for those elements.
- JsInterpretationOptions.compare can now return null. Consumers of its
result, including custom interpreters, must handle incomparable values
instead of assuming the result is always -1, 0, or 1.
stalniy
force-pushed
the
fix/ucast-edge-cases
branch
from
November 2, 2026 11:01
8f950f0 to
6e3ebab
Compare
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
to properly handle edge cases
What
Minor breaking changes which should not affect most of the users:
JavaScript coercion. For example, { a: '2' } no longer matches
{ a: { $lt: 10 } }. Raw @ucast/js Date/number comparisons also stop
matching; @ucast/mongo2js still normalizes Dates to numeric timestamps.
including missing fields, without calling custom comparators. Selecting
the legacy compare function does not restore this behavior.
[{}], or [[null]]. The corresponding ne results change inversely.
property. Mixed present/missing arrays stop matching, while empty arrays
start matching.
undefined, reversing its previous results.
getters, so getters can no longer supply values for those elements.
result, including custom interpreters, must handle incomparable values
instead of assuming the result is always -1, 0, or 1.