Skip to content

Instantly share code, notes, and snippets.

@resistdesign
Last active June 30, 2017 01:24
Show Gist options
  • Select an option

  • Save resistdesign/da4bbee3f4e92d715e4ddfa14c9fd18b to your computer and use it in GitHub Desktop.

Select an option

Save resistdesign/da4bbee3f4e92d715e4ddfa14c9fd18b to your computer and use it in GitHub Desktop.
Universal Query Structure (UQS)
// Query
{
type: 'OR_SET',
data: [
{
type: 'AND_SET',
data: [
{
type: 'CONDITION',
fieldName: 'myField',
operator: 'EQUALS',
value: 'Some Value'
},
{
type: 'OR_SET',
data: [
{
type: 'CONDITION',
fieldName: 'myField',
operator: 'EQUALS',
value: 'Some Value'
},
{
type: 'AND_SET',
data: [
{
type: 'CONDITION',
fieldName: 'myRelatedField',
operator: 'EQUALS',
value: { // A query for a nested collection OR embeded object.
type: 'OR_SET',
data: []
}
},
{
type: 'CONDITION',
fieldName: 'myField',
operator: 'EQUALS',
value: 'Some Value'
}
]
}
]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment