Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

ReactiveMongo find and remove methods have unituituve arguments #50

Description

@pncampbell

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions