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

Simple where filter #88

Closed
kenjiqq opened this issue Jul 8, 2014 · 2 comments
Closed

Simple where filter #88

kenjiqq opened this issue Jul 8, 2014 · 2 comments

Comments

@kenjiqq
Copy link

kenjiqq commented Jul 8, 2014

  if (options.allowSimpleWhere) {
    this.utils.forOwn(params, function (value, key) {
      if (!(key in reserved) && !(key in where)) {
        where[key] = {
          '==': value
        };
      }
    });
  }

With this code in the default filter no other operator then == is supported, so you can't use stuff like >, in etc. It should probably just reuse the operator that is defined in the simple where.

@kenjiqq kenjiqq changed the title Simpel where filter Simple where filter Jul 8, 2014
@jmdobry
Copy link
Member

jmdobry commented Jul 9, 2014

That is the one caveat of the simple where, it only supports ==.

When { name: 'John' } gets serialized to the query string, you get ?name=John, so I don't see how the simple where could support anything other than ==.

This is the only way to use operators other than ==, unless you want to override the default filter with your own.

{
  where: {
    name: {
       '!=': 'John'
     }
  }  
}

@kenjiqq
Copy link
Author

kenjiqq commented Jul 9, 2014

I can see that, maybe that should be documented on the filter page, that this is a limitation under the Shortcuts part

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

No branches or pull requests

2 participants