Skip to content

Latest commit

 

History

History
68 lines (47 loc) · 3.18 KB

File metadata and controls

68 lines (47 loc) · 3.18 KB

Session: Querying: How to query?

Database can be queried using QueryDSL-enabled query method with few custom extension that will be described later.

Syntax

{CODE:java query_1_0@ClientApi\Session\Querying\HowToQuery.java /}

Parameters
indexName String Name of an index to perform query on
isMapReduce boolean Indicates if queried index is a map/reduce index (modifies how we treat identifier properties).
Return Value
IRavenQueryable Instance implementing IRavenQueryable interface containing additional query methods.

{SAFE The default value of a page size for a query is 128 results. In order to retrieve a different number of results in a single query use .Take(pageSize) method. /}

Example I - Basic

{CODE:java query_1_1@ClientApi\Session\Querying\HowToQuery.java /}

Notice that by specifying Employee as a class parameter, we are not only defining a result type, but also marking name of collection that will be queried.

Example II - Syntax

Queries can be performed using strongly typed syntax.

{CODE:java query_1_2@ClientApi\Session\Querying\HowToQuery.java /}

Example III - Querying specified index

{CODE:java query_1_4@ClientApi\Session\Querying\HowToQuery.java /}

or

{CODE:java query_1_5@ClientApi\Session\Querying\HowToQuery.java /}

Custom methods and extensions

Available custom methods and extensions:

Related articles