Querying - gravbox/Gravitybox.Datastore GitHub Wiki

The query syntax is designed to be used on a URL. The query object can be serialized to a string that is URL friendly. The query object can be extended for SEO purposes to encode/decode specific dimensions like U.S. states in a search engine friendly way. The standard DataQuery object can be derived with additional functionality for specific business needs.

Standard query operators are supported like equals, not equals, less than, greater than, etc. There are some non-standard ones as we like ContainsAll, ContainsAny, and ContainsNone. This allows for some unique query constructions.

The data store also allows for aggregations. These are roughly analogous to grouping in SQL. This functionality allows one to define an aggregation operation like count, min, max, etc on a specific field narrowed with a where clause to returns aggregated information from the store. Any number of fields and aggregation functions can be defined in a query.

var results = repo.Query .FieldCount(x => x.ID) .Results(); var count = results.SelectDerivedValue(x => x.ID);