From e37920a1faef8ca2de2a0f9028fb8887282af4f8 Mon Sep 17 00:00:00 2001 From: CoDEmanX Date: Fri, 4 Sep 2015 22:40:51 +0200 Subject: [PATCH] Fix markdown, slightly re-organize simple query docs. --- Documentation/Books/Users/SUMMARY.md | 6 +++--- .../Books/Users/SimpleQueries/Access.mdpp | 18 ++++++++++++++++++ .../Books/Users/SimpleQueries/Pagination.mdpp | 6 +++--- .../Books/Users/SimpleQueries/README.mdpp | 18 ------------------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Documentation/Books/Users/SUMMARY.md b/Documentation/Books/Users/SUMMARY.md index e425ba5ca7..5dce2ef13b 100644 --- a/Documentation/Books/Users/SUMMARY.md +++ b/Documentation/Books/Users/SUMMARY.md @@ -44,11 +44,11 @@ * [Database Methods](Documents/DatabaseMethods.md) * [Working with Edges](Edges/README.md) * [Simple Queries](SimpleQueries/README.md) + * [Sequential Access](SimpleQueries/Access.md) + * [Pagination](SimpleQueries/Pagination.md) + * [Modification Queries](SimpleQueries/ModificationQueries.md) * [Geo Queries](SimpleQueries/GeoQueries.md) * [Fulltext Queries](SimpleQueries/FulltextQueries.md) - * [Pagination](SimpleQueries/Pagination.md) - * [Sequential Access](SimpleQueries/Access.md) - * [Modification Queries](SimpleQueries/ModificationQueries.md) * [Transactions](Transactions/README.md) * [Transaction invocation](Transactions/TransactionInvocation.md) * [Passing parameters](Transactions/Passing.md) diff --git a/Documentation/Books/Users/SimpleQueries/Access.mdpp b/Documentation/Books/Users/SimpleQueries/Access.mdpp index ec3e8306cb..70829aed5f 100644 --- a/Documentation/Books/Users/SimpleQueries/Access.mdpp +++ b/Documentation/Books/Users/SimpleQueries/Access.mdpp @@ -1,5 +1,23 @@ !CHAPTER Sequential Access and Cursors +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. + !SUBSECTION Has Next @startDocuBlock cursorHasNext diff --git a/Documentation/Books/Users/SimpleQueries/Pagination.mdpp b/Documentation/Books/Users/SimpleQueries/Pagination.mdpp index fa674941c3..a5df658f27 100644 --- a/Documentation/Books/Users/SimpleQueries/Pagination.mdpp +++ b/Documentation/Books/Users/SimpleQueries/Pagination.mdpp @@ -8,9 +8,9 @@ MySQL. *skip* used together with *limit* can be used to implement pagination. The *skip* operator skips over the first n documents. So, in order to create -result pages with 10 result documents per page, you can use *skip(n \* -10).limit(10)* to access the 10 documents on the n.th page. This result should -be sorted, so that the pagination works in a predicable way. +result pages with 10 result documents per page, you can use skip(n * +10).limit(10) to access the 10 documents on the *n*th page. This result +should be sorted, so that the pagination works in a predicable way. !SUBSECTION Limit diff --git a/Documentation/Books/Users/SimpleQueries/README.mdpp b/Documentation/Books/Users/SimpleQueries/README.mdpp index 898f58fcfc..ccca3d0c8c 100644 --- a/Documentation/Books/Users/SimpleQueries/README.mdpp +++ b/Documentation/Books/Users/SimpleQueries/README.mdpp @@ -8,22 +8,4 @@ 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). \ No newline at end of file