Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for projections in find() #69

Open
AjBreidenbach opened this issue Apr 15, 2019 · 0 comments
Open

Support for projections in find() #69

AjBreidenbach opened this issue Apr 15, 2019 · 0 comments

Comments

@AjBreidenbach
Copy link

It is currently not possible to perform complex find queries with projections such as

db.stores.find(
   { $text: { $search: "java coffee shop" } },
   { score: { $meta: "textScore" } }
).sort( { score: { $meta: "textScore" } } )

We could keep the convenient function signature and api proc find*[T:Mongo|AsyncMongo](c: Collection[T], filter: Bson, fields: seq[string] = @[]): Cursor[T], but include the following for additional use-cases:
proc find*[T:Mongo|AsyncMongo](c: Collection[T], fields: varargs[Bson]): Cursor[T]

Internally Cursor[T].fields would have to be represented as a BSON object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant