odmantic icon indicating copy to clipboard operation
odmantic copied to clipboard

Motor `get_database` method kwargs support

Open Olegt0rr opened this issue 4 years ago • 2 comments

Motor supports additional options for databases

def get_database(self, name=None, codec_options=None, read_preference=None,
                     write_concern=None, read_concern=None):
    ...

I always use feature with setting read_preference=ReadPreference.SECONDARY_PREFERRED. It's really helps with highload apps.

Why don't you pass this options to AIOEngine init?

Olegt0rr avatar Dec 11 '20 13:12 Olegt0rr

Thanks, yes support of additional preferences was totally planned. It should be included as well in the find/save method as well but setting it globally on the engine first is totally ok to me !

art049 avatar Dec 11 '20 18:12 art049