Wie kann ich eine Aggregation schreiben, ohne die maximale Dokumentgröße zu überschreiten?

Ich habeexceeds maximum document size problem Ausnahme von der Abfrage wie folgt,

pipe = [
    {"$match": { "birthday":{"$gte":datetime.datetime(1987, 1, 1, 0, 0)} }}
    ]
res =db.patients.aggregate(pipe,allowDiskUse=True)

Ich habe es durch Hinzufügen des @ behob$project Operator

Was aber, wenn das Dokument immer noch über16MB auch ich benutze$project ?

Was kann ich tun ? irgendeine Idee ? Vielen Dan

pipe = [
    {"$project": {"birthday":1, "id":1}
    },
    {"$match": { "birthday":{"$gte":datetime.datetime(1987, 1, 1, 0, 0)} }
     }
    ]
res =db.patients.aggregate(pipe,allowDiskUse=True)
Ausnahm
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)

Antworten auf die Frage(6)

Ihre Antwort auf die Frage