You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
To retrieve users by their email address, I would like to use a (previously created) collation index. Unfortunately I can't pass the necessary options to the find method of the mongo client. In the MongoDriver unknown FindOneOptions/FindOptions-properties are not passed to the MongoConnection or mongodb.collection.find.
Describe the solution you'd like
I would like to pass a property collation in the FindOptions for findOne or find, which is passed directly to the mongodb.collection.find function.
Describe alternatives you've considered
Instead of using a collation index, I could make the search case-insensitive by using a regular expression. However, this does not seem to me to be the recommended way.
Alternatively, I could set the collation for the entire collection, which would result in this collation being used by default - without having to include the collation in the FindOptions. But then all other queries would also use this collation, which is not desired e.g. for first/last names.
Additional context
I could imagine different approaches to solve this problem:
the find methods in MongoDriver and MongoConnection are extended by options.collation.
the find methods are changed so that excess options are passed directly to the mongo.collection.find method.
another hook beforeFind allows to manipulate the query (this seems to me a disproportionate amount of effort to fulfill this requirement, but might allow future use cases)
Is this feature something you would consider? In any case, thanks for the work on MikroORM!
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
To retrieve users by their email address, I would like to use a (previously created) collation index. Unfortunately I can't pass the necessary options to the find method of the mongo client. In the
MongoDriver
unknownFindOneOptions
/FindOptions
-properties are not passed to theMongoConnection
ormongodb.collection.find
.Describe the solution you'd like
I would like to pass a property
collation
in the FindOptions forfindOne
orfind
, which is passed directly to the mongodb.collection.find function.Describe alternatives you've considered
Instead of using a collation index, I could make the search case-insensitive by using a regular expression. However, this does not seem to me to be the recommended way.
Alternatively, I could set the collation for the entire collection, which would result in this collation being used by default - without having to include the collation in the
FindOptions
. But then all other queries would also use this collation, which is not desired e.g. for first/last names.Additional context
I could imagine different approaches to solve this problem:
MongoDriver
andMongoConnection
are extended byoptions.collation
.mongo.collection.find
method.beforeFind
allows to manipulate the query (this seems to me a disproportionate amount of effort to fulfill this requirement, but might allow future use cases)Is this feature something you would consider? In any case, thanks for the work on MikroORM!
The text was updated successfully, but these errors were encountered: