deepstreamIO / deepstream.io-provider-search-rethinkdb

A data-provider that makes every table searchable via rethinkdb

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query should support `contains` operator

ahmadsholehin opened this issue · comments

Example data model:
A project can have many collaborators, thus userIds are stored as an array in the collaborators field.
A user needs to query for projects that the user owns, as well projects that the user is a collaborator of.

Ideally, there should be a contains operator for a query as such:

{
  "table": "projects",
  "query": [
    [ "collaborators", "contains", "<userId>" ]
  ]
}

Any way this can be included?

Yup, the query parser class has a function which accepts mappings. Feel free to raise a PR and I’ll be happy to merge with a passing test!