Closed wojcikstefan closed 5 years ago
This code allows you to do either:
MongoReference(..., queryset=SomeDoc.objects)
MongoReference(..., queryset=lambda: SomeDoc.objects)
This new way allows you to pass in a custom queryset w/o triggering a MongoDB connection (which isestablished automatically as soon as SomeDoc.objects is called, at least for auth'd connections).
SomeDoc.objects
See https://github.com/closeio/closeio/issues/16338 for details.
Confirmed it runs without connecting to mongo in my test setup. 👍
This code allows you to do either:
MongoReference(..., queryset=SomeDoc.objects)
(the old way)MongoReference(..., queryset=lambda: SomeDoc.objects)
This new way allows you to pass in a custom queryset w/o triggering a MongoDB connection (which isestablished automatically as soon as
SomeDoc.objects
is called, at least for auth'd connections).See https://github.com/closeio/closeio/issues/16338 for details.