Alex Haller
Alex Haller

Reputation: 315

mongoengine enable "allowDiskUse"

Is there an option to allow disk use in mongoengine? I could not find any resources online.

I tried

model.objects.aggregate(pipeline, {'allowDiskUse': True})

which throws:

Each element of the 'pipeline' array must be an object

Upvotes: 1

Views: 904

Answers (1)

Alk
Alk

Reputation: 161

Pass it as keyword argument. Mongoengine then passes all keyword arguments further to pymongo's aggregate method

model.objects.aggregate(*pipeline, allowDiskUse=True)

Upvotes: 6

Related Questions