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

feat(objectDoesMatch): provide mongo-style comparison search operators #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sumartoyo
Copy link

@sumartoyo sumartoyo commented Feb 5, 2020

Stein can search only with equals search param, such as

search = {
  "registered_date": "2019-10-01"
}

This PR provides a functionality to search using MongoDB-style Comparison Query Operators such as

search = {
  "registered_date": {
    "$gte": "2019-10-01",
    "$lt": "2019-11-01",
  },
}

This way we can have more expressive search functionality.

Edit: now also supports Logical Query Operators such as

search = {
  "$or": [
    {"role":"admin"},
    {"department":"finance"}
  ],
}

@ans-4175
Copy link
Member

ans-4175 commented Feb 6, 2020

Have you tested this one?
I don't see any conflicting logic in comparison

@sumartoyo
Copy link
Author

I have tested all of the operators/combinations manually by requesting to the server. Could be better if we have unit test for this.

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

Successfully merging this pull request may close these issues.

3 participants