Skip to content
This repository has been archived by the owner on Apr 7, 2021. It is now read-only.

Add «OR» operator #82

Open
jpbecotte opened this issue Jul 10, 2017 · 0 comments
Open

Add «OR» operator #82

jpbecotte opened this issue Jul 10, 2017 · 0 comments

Comments

@jpbecotte
Copy link

A query can accepts many operands, like the following example:

var queryString = JSON.stringify({
  table: 'book',
  query: [
    	[ 'title', 'match', '^Harry Potter.*' ],
        [ 'price', 'lt', 15.30 ]
    ]
});
ds.record.getList( 'search?' + queryString );

But each opererand is executed like if they where seperated by a «AND» operator.

In SQL, this would results in the following WHERE clause: title LIKE 'Harry Potter%' AND price < 15.30.

I would like to be able to combine two operands with an «OR» operator. Something like ['or', ['title', 'eq', 'A title'], ['price', 'lt', 15.30]]would mean : Give me the list of all books that have 'A title' or that the price is less than 15.30.

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

No branches or pull requests

1 participant