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

ReactiveMongo find and remove methods have unituituve arguments #50

Open
pncampbell opened this issue Jan 28, 2016 · 1 comment
Open

Comments

@pncampbell
Copy link

I had to look at the implementation to work out what the first string in the tuple was for ...

override def find(query: (String, JsValueWrapper)_)(implicit ec: ExecutionContext): Future[List[A]] = {
collection.find(Json.obj(query: __)).cursorA.collectList //TODO: pass in ReadPreference
}

Surely it would be better just to pass in a single JsValueWrapper. As it is you cannot for example use basic equality short form queries with this API e.g. {surname:smith} because 'smith' isnt a compound value and therefore cannot be encded using Json.obj so instead I have to use {surname:{$eq:smith}}

Its confusing and inconsistent with pretty much evey other mongo API (IMO anyway). Ditto for remove.

@duncancrawford
Copy link
Contributor

Please feel free to submit a PR to help improve the product

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

2 participants