Skip to content

Instantly share code, notes, and snippets.

@pwgustafson
Last active April 8, 2016 01:32
Show Gist options
  • Save pwgustafson/71ed0559807eec361a6bb8ed05e0a06a to your computer and use it in GitHub Desktop.
Save pwgustafson/71ed0559807eec361a6bb8ed05e0a06a to your computer and use it in GitHub Desktop.
An example query
{
statements: [
{ property: 'city', operation: '=', value: 'Costa Mesa, Newport Beach' },
{ property: 'status', operation: '=', value: 'Active', func: 'and' },
{ property: 'min_beds', operation: '=', value: 3, func: 'and' },
{ property: 'max_beds', operation: '=', value: 4, func: 'and' },
{ property: 'min_baths_search', operation: '=', value: 2, func: 'and' },
{ property: 'max_baths_search', operation: '=', value: 3, func: 'and' },
{ property: 'min_price_list', operation: '=', value: 800000, func: 'and' },
{ property: 'max_price_list', operation: '=', value: 900000, func: 'and' },
{
group: [
{property: 'status', operation: '=', value: '-Active'},
{property: 'date_offmarket', operation: '>=', value: '2016-01-01', func: 'and'}
], func: 'or'
}
]
}
@pwgustafson
Copy link
Author

@jondruse I was playing around a bit with this whole query language filter idea, and started working on a basic query that might look similar to an MLX query. Maybe I am thinking about this wrong, but wouldn't this query also not work, because by adding this or, the first group of params would get you what you want, however anything matching the or filters would return results way outside the original set of filters...

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