Open dphaener opened 8 years ago
As previously discussed, a possible implementation would look like this:
Have an ordered list of query operators:
["$between", "$order_by", "$filter"]
We can then use that list to process the operators in the proper order. We can also accept a top level item on the query object to allow custom operator ordering, and use that list instead:
{
"$table":"movies",
"$operator_order":["$order_by", "$between", "$filter"],
"$query": []
}
This does raise the question though, what if all operators aren't passed into the custom array. My initial thought would be to just append those last, after all others are appended in the proper order.
When constructing a ReQL query, ordering is important. For instance, this query will run fine:
But this will not:
There needs to be a sensible way to ensure that the query items are parsed and appended in the appropriate order.