Click to Rate and Give Feedback
MSDN
MSDN Library
Live Services SDK
Live Framework SDK
 Live Framework Filter Query Operato...

  Switch on low bandwidth view
Live Framework Filter Query Operators
[This is preliminary documentation and is subject to change.]

The $filter operator enables you to evaluate an expression against a resource collection or collections and return the set of resources that match the expression.

The basic syntax of a filter query is:

$filter=(element%20operator%20value)

element

Any valid XML element within the schema. Element parameters are case-sensitive; "title" is not the same as "Title."

operator

One of the following basic equality operators:

Operator Meaning

eq

Equal

ge

Greater than or equal

gt

Greater than

le

Less than or equal

lt

Less than

ne

Not equal

value

The value to which the value of element is compared.

Filter parameters can be combined using the following operators:

Operator Meaning

and

true if both criteria are true.

not

true if criterion is not true.

or

true if either criterion is true.

The following string functions can be used in a $filter clause, enabling you to prune the number of results returned in the result set.

Operator Meaning

contains

Returns a collection of data entries that contain the specified string.

startswith

Returns a collection of data entries that begin with the specified string.

endswith

Returns a collection of data entries that end with the specified string.

toupper

Returns a collection of data entries that match the uppercase specified string.

tolower

Returns a collection of data entries that match the lowercase specified string.

substring

Returns a collection of data entries that match the specified substring at a character position greater than the specified (integer) index value.

eq (Equals) Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
?$filter=(Title eq ‘LiveMeshFiles’)

Description

The server returns a collection of data feeds where Title equals "LiveMeshFiles."

lt (Less Than) Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/?$filter=(PublishDate lt ‘2008-08-01’)

Description

The server returns a collection of MeshObjects that were published before 8/1/2008.

and Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
?$filter=(Title eq ‘LiveMeshFiles’ and Type eq ‘LiveMeshFiles’)

Description

The server returns a collection of data feeds where Title equals "LiveMeshFiles" and Type equals "LiveMeshFiles."

contains Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
{dataFeedID}/DataEntries/?$filter=contains(Title, ‘jpg’)

Description

The server returns a collection of data entries whose Title contains "jpg."

endswith Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
{dataFeedID}/DataEntries/?$filter=endswith(Title, ‘jpg’)

Description

The server returns a collection of data entries whose Title ends with "jpg."

startswith Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
{dataFeedID}/DataEntries/?$filter=startswith(Title, ‘DSC’)

Description

The server returns a collection data entries whose Title starts with "DSC."

tolower Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
{dataFeedID}/DataEntries?$filter=tolower(Title)%20eq%20(‘creek.jpg’)

Description

The server returns a collection of data entries whose lowercase Title equals "creek.jpg."

toupper Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
{dataFeedID}/DataEntries/?$filter=toupper(Title)%20eq%20(‘CREEK.JPG’)

Description

The server returns a collection data entries whose uppercase Title equals "CREEK.JPG."

substring Operator Example

HTTP Request

GET https://user-ctp.windows.net/V0.1/Mesh/MeshObjects/{meshObjectID}/DataFeeds/
{dataFeedID}/DataEntries/?$filter=substring(Title,5)%20eq%20(‘.jpg’)

Description

The server returns a collection of data entries whose Title substring equals ".jpg" after the fifth character.

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker