public class AqlQueryOptions extends Object
Constructor and Description |
---|
AqlQueryOptions() |
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 Long getMemoryLimit()
public AqlQueryOptions memoryLimit(Long memoryLimit)
memoryLimit
- the maximum number of memory (measured in bytes) that the query is allowed to use. If set, then the
query will fail with error "resource limit exceeded" in case it allocates too much memory. A value of
0 indicates that there is no memory limit.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 com.arangodb.velocypack.VPackSlice getBindVars()
protected AqlQueryOptions bindVars(com.arangodb.velocypack.VPackSlice bindVars)
bindVars
- key/value pairs representing the bind parametersprotected String getQuery()
protected AqlQueryOptions query(String query)
query
- the query which you want parsepublic Boolean getFailOnWarning()
public AqlQueryOptions failOnWarning(Boolean failOnWarning)
failOnWarning
- When set to true, the query will throw an exception and abort instead of producing a warning. This
option should be used during development to catch potential issues early. When the attribute is set to
false, warnings will not be propagated to exceptions and will be returned with the query result. There
is also a server configuration option --query.fail-on-warning for setting the default value for
failOnWarning so it does not need to be set on a per-query level.public 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 Long getMaxTransactionSize()
public AqlQueryOptions maxTransactionSize(Long maxTransactionSize)
maxTransactionSize
- Transaction size limit in bytes. Honored by the RocksDB storage engine only.public Long getMaxWarningCount()
public AqlQueryOptions maxWarningCount(Long maxWarningCount)
maxWarningCount
- Limits the maximum number of warnings a query will return. The number of warnings a query will return
is limited to 10 by default, but that number can be increased or decreased by setting this attribute.public Long getIntermediateCommitCount()
public AqlQueryOptions intermediateCommitCount(Long intermediateCommitCount)
intermediateCommitCount
- Maximum number of operations after which an intermediate commit is performed automatically. Honored by
the RocksDB storage engine only.public Long getIntermediateCommitSize()
public AqlQueryOptions intermediateCommitSize(Long intermediateCommitSize)
intermediateCommitSize
- Maximum total size of operations after which an intermediate commit is performed automatically.
Honored by the RocksDB storage engine only.public Double getSatelliteSyncWait()
public AqlQueryOptions satelliteSyncWait(Double satelliteSyncWait)
satelliteSyncWait
- This enterprise parameter allows to configure how long a DBServer will have time to bring the
satellite collections involved in the query into sync. The default value is 60.0 (seconds). When the
max time has been reached the query will be stopped.public Boolean getSkipInaccessibleCollections()
public AqlQueryOptions skipInaccessibleCollections(Boolean skipInaccessibleCollections)
skipInaccessibleCollections
- AQL queries (especially graph traversals) will treat collection to which a user has no access rights
as if these collections were empty. Instead of returning a forbidden access error, your queries will
execute normally. This is intended to help with certain use-cases: A graph contains several
collections and different users execute AQL queries on that graph. You can now naturally limit the
accessible results by changing the access rights of users on collections. This feature is only
available in the Enterprise Edition.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–2018 ArangoDB GmbH. All rights reserved.