mongomock
mongomock copied to clipboard
Small library for mocking pymongo collection objects for testing purposes
The problem arises when we try to use the addToSet function with a boolean field. In our use case, we have a boolean field 'is_flag'. When we try to use...
Does not include `onError`, `onNull`, or any `to` string identifier that has not already been implemented.
Hello, I am trying to update a document but I got this error. Follow above the command. ````python self._collection.update_one( {"taxId": tax_id, "someField": {"$ne": product.lower()}}, [ { "$set": { "someField": {...
Add `$setIntersection` operator.
Add support for `let` and `pipeline` in lookup stage. Also supports complex let values, like: ``` "let": { "owner": "$owner_id", "latest_story_id": {"$last": {"$slice": ["$owner.story", -1]}}, } ```
This adds support for the [$unset](https://www.mongodb.com/docs/manual/reference/operator/aggregation/unset/) aggregation operator. It fixes #740. Built against spec, and checked against a local db implementation and the behavior matched.
Add support for $count within a $group stage of an aggregation.
Currently mongomock doesn't support the $redact stage within aggregation pipelines.
This PR revives https://github.com/mongomock/mongomock/pull/742 Hi @pcorpet, I hope you are doing well. Since many folks are still interested in this change, I would appreciate your review.
In mocking scenario usually the database is significantly reduced, so the needs os allowDiskUse option is usually not needed, but in production it may be needed, for me it is...