We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting an AssertionError on a $multiply aggregation, which is not compatible with pymongo
AssertionError
$multiply
pymongo
Aggregation:
collection.aggregate([ {"$match": {'some_id': 1}}, {'$project': {'_id': {'some_id': 'some_id'}, 'max_score': {'$multiply': [bson.Decimal128("34"), 8]}}} ])
Exception:
AssertionError: $multiply only uses numbers
import datetime import mongomock import bson import pymongo import pytest @pytest.mark.parametrize("name,db", [('pymongo', pymongo.MongoClient().db), ('mongomock',mongomock.MongoClient().db)]) def test_increase_votes_pymongo(name, db): collection = db['collection'] collection.insert_one({ 'date_applied': datetime.datetime.now(tz=datetime.timezone.utc), 'some_id': 1 }) print(list(collection.aggregate([ {"$match": {'some_id': 1}}, {'$project': {'_id': {'some_id': 'some_id'}, 'max_score': {'$multiply': [bson.Decimal128("34"), 8]}}} ])))
will fail on MongoMock only
versions: pymongo==4.6.1 mongomock==4.1.2
pymongo==4.6.1
mongomock==4.1.2
The text was updated successfully, but these errors were encountered:
No branches or pull requests
issue
Getting an
AssertionError
on a$multiply
aggregation, which is not compatible withpymongo
Aggregation:
Exception:
reproduce
will fail on MongoMock only
additional info
versions:
pymongo==4.6.1
mongomock==4.1.2
The text was updated successfully, but these errors were encountered: