Skip to content

fix in operator not behaving like mongodb when trying to compare to a… - #795

Open
orireiter wants to merge 2 commits into
mongomock:developfrom
orireiter:fix_in_operator_not_behaving_like_mongodb
Open

orireiter wants to merge 2 commits into
mongomock:developfrom
orireiter:fix_in_operator_not_behaving_like_mongodb

Conversation

@orireiter

Copy link
Copy Markdown

… value of an empty list

@orireiter

orireiter commented Jul 16, 2022 •

Copy link
Copy Markdown
Author

hi, i created a PR trying to fix the following issue:
fix #706

would love to get feedback as to how to contribute the right way.
thanks!

@pcorpet pcorpet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your suggestion, please address my comments before I merge.

Comment thread mongomock/filtering.py Resolved
@orireiter
orireiter requested a review from pcorpet July 18, 2022 20:02
@codecov

codecov Bot commented Jul 18, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #795 (102f5aa) into develop (d5fc4c7) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop     #795   +/-   ##
========================================
  Coverage    95.29%   95.29%           
========================================
  Files           20       20           
  Lines         3849     3849           
========================================
  Hits          3668     3668           
  Misses         181      181           
Impacted Files Coverage Δ
mongomock/filtering.py 99.03% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5fc4c7...102f5aa. Read the comment docs.

engFelipeMonteiro added a commit to engFelipeMonteiro/mongomock-ng that referenced this pull request May 21, 2026
Replicates mongomock#692 — closes #191 (immutable projection)
Replicates mongomock#795 — closes #184 ($in comparison)
Replicates mongomock#819 — closes #178 ($slice parsing)
Replicates mongomock#847 — closes #170 ($addToSet $each)
Replicates mongomock#860 — closes #169 ($redact support)
Replicates mongomock#895 — closes #158 (collation signature)
Replicates mongomock#919 — closes #154 ($in array matching)
Replicates mongomock#933 — closes #147 (BulkOpBuilder sort)
Replicates mongomock#936 — closes #145 (NaN handling)
Replicates mongomock#944 — closes #144 (utcnow deprecation)

Version bump: 7.4.0 -> 7.4.1
engFelipeMonteiro added a commit to engFelipeMonteiro/mongomock-ng that referenced this pull request May 21, 2026
## [7.4.1] - 2026-05-21
### Changed
- Drop Python 3.14 from test matrix and classifiers — not yet stable, incompatible with runtime dependencies
- Add pymongo 4.12.0 and 4.14.0 to hatch-test matrix for broader compatibility coverage

### Fixed
- TTL document expiry no longer crashes on Python 3.13 — normalize naive datetimes to UTC-aware before subtraction in `_value_meets_expiry` (store.py)
- Replace deprecated `datetime.utcfromtimestamp` with `datetime.fromtimestamp(..., tz=timezone.utc)` in aggregation `$convert` to date handlers (aggregate.py)
- Replace deprecated `datetime.utcnow()` with `datetime.now(timezone.utc).replace(tzinfo=None)` in helpers and test suite
- Fix hatch-test matrix so environment `hatch-test.*-4.11.0` correctly installs `pymongo==4.11.0` (missing `if` clause)
- `find()` projection no longer mutates original document data (mongomock#692 — closes #191)
- `$in` operator correctly handles empty-list values (mongomock#795 — closes #184)
- `$slice` aggregation operator evaluates arguments as expressions (mongomock#819 — closes #178)
- `$addToSet` with `$each` correctly deduplicates repeated values across runs (mongomock#847 — closes #170)
- `$redact` aggregation stage now supported (mongomock#860 — closes #169)
- `Cursor.collation` matches PyMongo 4.x method signature (mongomock#895 — closes #158)
- `$in` operator matches whole arrays in document values (mongomock#919 — closes #154)
- `BulkOperationBuilder.add_update` and `_update` support `sort` parameter (mongomock#933 — closes #147)
- NaN comparison handling in filter `$eq` operator (mongomock#936 — closes #145)
- Replace deprecated `datetime.utcnow` with `datetime.now(UTC)` on Python 3.11+ (mongomock#944 — closes #144)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants