Reported initially at [#7935] this occurs during a project export, probably other places too:
OperationFailure: command SON([('aggregate', u'attachment.files'), ('pipeline', [{'$match': {'_id': {'$in': []}}}, {'$group': {'total_size': {'$sum': '$length'}, '_id': 'total'}}, {'$project': {'total_size': {'$divide': ['$total_size', 1000000]}, '_id': 0}}])]) on namespace project-data.$cmd failed: The 'cursor' option is required, except for aggregate with the explain argument
Documentation about it: https://docs.mongodb.com/manual/release-notes/3.6-compatibility/#aggregate-command-and-results and https://docs.mongodb.com/manual/reference/command/aggregate/#example
Done on db/8348 branch
Upgrade notes if using Docker
docker-compose.yml
anddocker-compose-prod.yml
updated Mongo from 3.4 to 4.2 but it is not possible to upgrade that far all at once. Older installations may have mongo in a 3.2 compatibility mode as well. To upgrade a docker instance:docker-compose run --rm mongo mongo --host mongo project-data
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )
db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
docker-compose.yml
one version (e.g.mongo:3.6
)docker-compose stop mongo
docker-compose up -d
docker-compose run --rm mongo mongo --host mongo project-data
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )
Refer to the offical docs for more details:
https://docs.mongodb.com/manual/release-notes/3.4/#upgrade-procedures
https://docs.mongodb.com/manual/release-notes/3.6/#upgrade-procedures
https://docs.mongodb.com/manual/release-notes/4.0/#upgrade-procedures
https://docs.mongodb.com/manual/release-notes/4.2/#upgrade-procedures