mongodb - Pymongo can not perform aggregating with pipeline in too large collection -
i have billions records in patients colletion
, have no idea how filter pipeline.
or limit on mongodb, couldn't aggregate pipeline on large collection ?
i've add allowdiskuse=true
option, doesn't work too.
how filtered result pipeline ?
how store filtered result collection ?
sample code (i use pymongo
follows in python syntax )
import datetime pipeline = [ {"$project": {"birthday":1, "id":1} }, { "$match": { "birthday":{"$gte":datetime.datetime(1987, 1, 1, 0, 0)} } },{"$group": ~~~ } ] res =db.patients.aggregate(pipeline,allowdiskuse=true)
exception message
operationfailure: command son([('aggregate', u'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)
how
store result in collection
, aggregation pass on it. it's limitation of mongo
, can read more here.
Comments
Post a Comment