DocumentClient.CreateUserQuery DocumentClient.CreateUserQuery Method

Definition

Overloads

CreateUserQuery(Uri, String, FeedOptions) CreateUserQuery(Uri, String, FeedOptions)

Extension method to create a query for users in the Azure Cosmos DB service.

CreateUserQuery(String, String, FeedOptions) CreateUserQuery(String, String, FeedOptions)

Overloaded. This method creates a query for users under an Azure Cosmos DB service. It returns IQueryable{dynamic}.

CreateUserQuery(Uri, SqlQuerySpec, FeedOptions) CreateUserQuery(Uri, SqlQuerySpec, FeedOptions)

Extension method to create a query for users in the Azure Cosmos DB service.

CreateUserQuery(Uri, FeedOptions) CreateUserQuery(Uri, FeedOptions)

Extension method to create a query for users in the Azure Cosmos DB service.

CreateUserQuery(String, FeedOptions) CreateUserQuery(String, FeedOptions)

Overloaded. This method creates a query for users under an Azure Cosmos DB service. It returns IOrderedQueryable{User}.

CreateUserQuery(String, SqlQuerySpec, FeedOptions) CreateUserQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for users under an Azure Cosmos DB database using a SQL statement with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

CreateUserQuery(Uri, String, FeedOptions) CreateUserQuery(Uri, String, FeedOptions)

Extension method to create a query for users in the Azure Cosmos DB service.

public System.Linq.IQueryable<dynamic> CreateUserQuery (Uri usersUri, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = null);
abstract member CreateUserQuery : Uri * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateUserQuery : Uri * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>

Parameters

usersUri
Uri Uri

the URI to the users.

sqlExpression
String String

The sql query.

feedOptions
FeedOptions FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

CreateUserQuery(String, String, FeedOptions) CreateUserQuery(String, String, FeedOptions)

Overloaded. This method creates a query for users under an Azure Cosmos DB service. It returns IQueryable{dynamic}.

public System.Linq.IQueryable<dynamic> CreateUserQuery (string usersLink, string sqlExpression, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = null);
abstract member CreateUserQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateUserQuery : string * string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>

Parameters

usersLink
String String

The path link for the users under a database, e.g. dbs/db_rid/users/.

sqlExpression
String String

The SQL statement.

feedOptions
FeedOptions FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

an IQueryable{dynamic} that can evaluate the query.

Implements

Examples

This example below queries for users by id.


User user = client.CreateUserQuery(usersLink, "SELECT * FROM users u WHERE u.id = 'userid5'").AsEnumerable().FirstOrDefault();

Remarks

Refer to https://msdn.microsoft.com/en-us/library/azure/dn782250.aspx and http://azure.microsoft.com/documentation/articles/documentdb-sql-query/ for syntax and examples.

See also

CreateUserQuery(Uri, SqlQuerySpec, FeedOptions) CreateUserQuery(Uri, SqlQuerySpec, FeedOptions)

Extension method to create a query for users in the Azure Cosmos DB service.

public System.Linq.IQueryable<dynamic> CreateUserQuery (Uri usersUri, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = null);
abstract member CreateUserQuery : Uri * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateUserQuery : Uri * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>

Parameters

usersUri
Uri Uri

the URI to the users.

querySpec
SqlQuerySpec SqlQuerySpec

The sql query.

feedOptions
FeedOptions FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

CreateUserQuery(Uri, FeedOptions) CreateUserQuery(Uri, FeedOptions)

Extension method to create a query for users in the Azure Cosmos DB service.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.User> CreateUserQuery (Uri usersUri, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = null);
abstract member CreateUserQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.User>
override this.CreateUserQuery : Uri * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.User>

Parameters

usersUri
Uri Uri

the URI to the users.

feedOptions
FeedOptions FeedOptions

The options for processing the query results feed.

Returns

The query result set.

Implements

CreateUserQuery(String, FeedOptions) CreateUserQuery(String, FeedOptions)

Overloaded. This method creates a query for users under an Azure Cosmos DB service. It returns IOrderedQueryable{User}.

public System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.User> CreateUserQuery (string usersLink, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = null);
abstract member CreateUserQuery : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.User>
override this.CreateUserQuery : string * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IOrderedQueryable<Microsoft.Azure.Documents.User>

Parameters

usersLink
String String

The path link for the users under a database, e.g. dbs/db_rid/users/.

feedOptions
FeedOptions FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

An IOrderedQueryable{User} that can evaluate the query.

Implements

Examples

This example below queries for users by id.


User user = client.CreateUserQuery(usersLink).Where(u => u.Id == "userid5").AsEnumerable().FirstOrDefault();
See also

CreateUserQuery(String, SqlQuerySpec, FeedOptions) CreateUserQuery(String, SqlQuerySpec, FeedOptions)

Overloaded. This method creates a query for users under an Azure Cosmos DB database using a SQL statement with parameterized values. It returns an IQueryable{dynamic}. For more information on preparing SQL statements with parameterized values, please see SqlQuerySpec.

public System.Linq.IQueryable<dynamic> CreateUserQuery (string usersLink, Microsoft.Azure.Documents.SqlQuerySpec querySpec, Microsoft.Azure.Documents.Client.FeedOptions feedOptions = null);
abstract member CreateUserQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>
override this.CreateUserQuery : string * Microsoft.Azure.Documents.SqlQuerySpec * Microsoft.Azure.Documents.Client.FeedOptions -> System.Linq.IQueryable<obj>

Parameters

usersLink
String String

The path link for the users under a database, e.g. dbs/db_rid/users/.

querySpec
SqlQuerySpec SqlQuerySpec

The SqlQuerySpec instance containing the SQL expression.

feedOptions
FeedOptions FeedOptions

The options for processing the query result feed. For details, see FeedOptions

Returns

an IQueryable{dynamic> that can evaluate the query.

Implements

Examples

This example below queries for users by id.


var query = new SqlQuerySpec(
    "SELECT * FROM users u WHERE u.id = @id", 
    new SqlParameterCollection(new SqlParameter[] { new SqlParameter { Name = "@id", Value = "userid5" }}));
    
User user = client.CreateUserQuery(usersLink, query).AsEnumerable().FirstOrDefault();

Remarks

Refer to https://msdn.microsoft.com/en-us/library/azure/dn782250.aspx and http://azure.microsoft.com/documentation/articles/documentdb-sql-query/ for syntax and examples.

See also

Applies to