1
0
Fork 0
arangodb/Documentation/Books/Users/SimpleQueries
Thomas Schmidts e799dfa8f9 Fixed #1007 spelling error fixed 2014-12-05 14:28:08 +01:00
..
Access.mdpp Exchanged verbinclude with Arangosh for bett examples in gitbook 2014-06-26 13:41:17 +02:00
FulltextQueries.mdpp fixed documentation 2014-11-06 13:39:35 +01:00
GeoQueries.mdpp fixed documentation 2014-10-08 15:14:52 +02:00
ModificationQueries.mdpp Some changes in the code documentation and fixed spelling errors 2014-06-26 15:54:29 +02:00
Pagination.mdpp Fixed #1007 spelling error fixed 2014-12-05 14:28:08 +01:00
README.mdpp Fixed a few spelling and code erros and deleted last examples 2014-07-02 17:48:54 +02:00

README.mdpp

!CHAPTER Simple Queries

Simple queries can be used if the query condition is straight forward, i.e., a
document reference, all documents, a query-by-example, or a simple geo query. In
a simple query you can specify exactly one collection and one query criteria. In
the following sections we describe the JavaScript shell interface for simple
queries, which you can use within the ArangoDB shell and within actions and
transactions. For other languages see the corresponding language API
documentation.

If a query returns a cursor, then you can use *hasNext* and *next* to
iterate over the result set or *toArray* to convert it to an array.

If the number of query results is expected to be big, it is possible to 
limit the amount of documents transferred between the server and the client
to a specific value. This value is called *batchSize*. The *batchSize*
can optionally be set before or when a simple query is executed.
If the server has more documents than should be returned in a single batch,
the server will set the *hasMore* attribute in the result. It will also
return the id of the server-side cursor in the *id* attribute in the result.
This id can be used with the cursor API to fetch any outstanding results from
the server and dispose the server-side cursor afterwards.

The initial *batchSize* value can be set using the *setBatchSize*
method that is available for each type of simple query, or when the simple
query is executed using its *execute* method. If no *batchSize* value
is specified, the server will pick a reasonable default value.

You can find a list of queries at [Collection Methods](../Documents/DocumentMethods.md).