Ticket #5510 (closed enhancement: fixed)

Opened 11 months ago

Last modified 7 months ago

dojo.data query supporting OR operations

Reported by: guest Owned by: jaredj
Priority: normal Milestone: 1.2
Component: Data Version: 1.0
Severity: normal Keywords: data query
Cc:

Description (last modified by jaredj) (diff)

A dojo.data query only supports ANDing clauses together by its nature, but ORing is really necessary in my book. It would be nice to see that implemented, maybe even a SQL syntax (for which you don't need an underlying SQL- driven database, just think of http://search.cpan.org/dist/SQL-Abstract/lib/SQL/Abstract.pm).

But the focus lies on adding OR/NOT/XOR support to a query. Maybe like this:

{ query: { name: { or: ["sam", "tom"] } }

Or maybe:

{query: {name: "sam||tom"} }

More versatile would be an optional user defined callback:

{query: function(item) { return (item["name"] == "sam" || item["name"] == "tom"); } }

Change History

Changed 11 months ago by dmachi

Note that dojo.data doesn't define any particular query structure, its is the stores themselves that define the query structure. jsonPathStore also does support more sophisticated queries, however it is not included in any release version of dojo yet and there are a few cases where we need to make some modifications to widgets to ensure they stay query language agnostic for it to be more useful.

Changed 11 months ago by jaredj

User defined functions would be pointless if the store is a pass through to a server. There is no guarantee the back end server could handle JavaScript?.

The other options might be feasible, but we do state the query syntax is more or less up to the store, but we do make recommendations on a minimal sort of format that would be good if all stores supported (so widgets can work fairly easily with them).

Changed 9 months ago by dylan

  • summary changed from dojo,data query supporting OR operations to dojo.data query supporting OR operations
  • milestone set to 1.2

Changed 7 months ago by jaredj

  • status changed from new to closed
  • resolution set to fixed
  • description modified (diff)

A user submitted a store that supports an and/or query synta that was basedon ITemFile store. After review and some cleanup, it has been committed into dojox. (dojox.data.AndOr?*Store)

Note: See TracTickets for help on using tickets.