public class AqlQueryOptions extends Object
Constructor and Description |
---|
AqlQueryOptions() |
Modifier and Type | Method and Description |
---|---|
AqlQueryOptions |
batchSize(Integer batchSize) |
protected AqlQueryOptions |
bindVars(Map<String,Object> bindVars) |
AqlQueryOptions |
cache(Boolean cache) |
AqlQueryOptions |
count(Boolean count) |
AqlQueryOptions |
fullCount(Boolean fullCount) |
Integer |
getBatchSize() |
protected Map<String,Object> |
getBindVars() |
Boolean |
getCache() |
Boolean |
getCount() |
Boolean |
getFullCount() |
Integer |
getMaxPlans() |
Boolean |
getProfile() |
protected String |
getQuery() |
Collection<String> |
getRules() |
Integer |
getTtl() |
AqlQueryOptions |
maxPlans(Integer maxPlans) |
AqlQueryOptions |
profile(Boolean profile) |
protected AqlQueryOptions |
query(String query) |
AqlQueryOptions |
rules(Collection<String> rules) |
AqlQueryOptions |
ttl(Integer ttl) |
public Boolean getCount()
public AqlQueryOptions count(Boolean count)
count
- indicates whether the number of documents in the result set should be returned in the "count"
attribute of the result. Calculating the "count" attribute might have a performance impact for some
queries in the future so this option is turned off by default, and "count" is only returned when
requested.public Integer getTtl()
public AqlQueryOptions ttl(Integer ttl)
ttl
- The time-to-live for the cursor (in seconds). The cursor will be removed on the server automatically
after the specified amount of time. This is useful to ensure garbage collection of cursors that are
not fully fetched by clients. If not set, a server-defined value will be used.public Integer getBatchSize()
public AqlQueryOptions batchSize(Integer batchSize)
batchSize
- maximum number of result documents to be transferred from the server to the client in one roundtrip.
If this attribute is not set, a server-controlled default value will be used. A batchSize value of 0
is disallowed.public Boolean getCache()
public AqlQueryOptions cache(Boolean cache)
cache
- flag to determine whether the AQL query cache shall be used. If set to false, then any query cache
lookup will be skipped for the query. If set to true, it will lead to the query cache being checked
for the query if the query cache mode is either on or demand.protected AqlQueryOptions bindVars(Map<String,Object> bindVars)
bindVars
- key/value pairs representing the bind parametersprotected String getQuery()
protected AqlQueryOptions query(String query)
query
- the query which you want parsepublic Boolean getProfile()
public AqlQueryOptions profile(Boolean profile)
profile
- If set to true, then the additional query profiling information will be returned in the sub-attribute
profile of the extra return attribute if the query result is not served from the query cache.public Boolean getFullCount()
public AqlQueryOptions fullCount(Boolean fullCount)
fullCount
- if set to true and the query contains a LIMIT clause, then the result will have an extra attribute
with the sub-attributes stats and fullCount, { ... , "extra": { "stats": { "fullCount": 123 } } }. The
fullCount attribute will contain the number of documents in the result before the last LIMIT in the
query was applied. It can be used to count the number of documents that match certain filter criteria,
but only return a subset of them, in one go. It is thus similar to MySQL's SQL_CALC_FOUND_ROWS hint.
Note that setting the option will disable a few LIMIT optimizations and may lead to more documents
being processed, and thus make queries run longer. Note that the fullCount attribute will only be
present in the result if the query has a LIMIT clause and the LIMIT clause is actually used in the
query.public Integer getMaxPlans()
public AqlQueryOptions maxPlans(Integer maxPlans)
maxPlans
- Limits the maximum number of plans that are created by the AQL query optimizer.public Collection<String> getRules()
public AqlQueryOptions rules(Collection<String> rules)
rules
- A list of to-be-included or to-be-excluded optimizer rules can be put into this attribute, telling the
optimizer to include or exclude specific rules. To disable a rule, prefix its name with a -, to enable
a rule, prefix it with a +. There is also a pseudo-rule all, which will match all optimizer rulesCopyright © 2016 ArangoDB GmbH. All rights reserved.