I received the request exceeds maximum document size problem on request as follows:
pipe = [ {"$match": { "birthday":{"$gte":datetime.datetime(1987, 1, 1, 0, 0)} }} ] res =db.patients.aggregate(pipe,allowDiskUse=True)
I fixed it by adding the $project operator,
However, what if the document is still over 16MB , do I even use $project ?
What can I do? Any ideas? Thanks you
pipe = [ {"$project": {"birthday":1, "id":1} }, {"$match": { "birthday":{"$gte":datetime.datetime(1987, 1, 1, 0, 0)} } } ] res =db.patients.aggregate(pipe,allowDiskUse=True)
An exception
OperationFailure: command SON([('aggregate', 'patients'), ('pipeline', [{'$match': {'birthday': {'$gte': datetime.datetime(1987, 1, 1, 0, 0)}}}]), ('allowDiskUse', True)]) on namespace tw_insurance_security_development.$cmd failed: exception: aggregation result exceeds maximum document size (16MB)
mongodb pymongo
newBike
source share