SDS uses a simple text-based query language, based on the
LINQ pattern for C#.
You can scope queries to either an individual authority or
to an individual container:
- You can query an authority for the containers
within it that match a specified condition.
- You can query a container for the entities
within it that match a specified condition.
An SDS query takes the following format:
from e in entities [where condition] select e
Note that the from e
in entities format applies regardless of whether you are retrieving
containers or entities. In SDS, authorities, containers, and entities are all
types of flexible entities.
To submit your query, you must specify the scope and then
supply the query expression. For example, to query for containers by using the
REST protocol, you simply append your query to the authority URI as a query
string:
https://london.data.beta.mssds.com/v1/?='from e in entities…'
Similarly, to query for entities, you append your query to
the container URI:
https://london.data.beta.mssds.com/v1/<container-id>/?='from
e in entities…'
You can use comparison operators and Boolean operators to
add conditions to your queries. The current beta version of SDS supports the
following operators:
|