1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Jan Steemann 2014-06-23 17:46:25 +02:00
commit f72ccde9cf
14 changed files with 616 additions and 606 deletions

View File

@ -949,7 +949,7 @@ static int utf8_getchars(char *buf, int c)
*/
static int get_char(struct current *current, size_t pos)
{
if (pos >= 0 && pos < current->chars) {
if (/*pos >= 0 &&*/pos < current->chars) {
int c;
int i = utf8_index(current->buf, pos);
(void)utf8_tounicode(current->buf + i, &c);
@ -960,7 +960,7 @@ static int get_char(struct current *current, size_t pos)
static void displayItems(const struct linenoiseCompletions * lc, struct current *current, int max_len)
{
size_t wcols = current->cols;
size_t cols = max_len > wcols ? 1 : wcols/(max_len+2);
size_t cols = (size_t)max_len > wcols ? 1 : wcols/((size_t)max_len+2);
size_t rows = (int)ceil((float)lc->len/cols);
size_t i, j;
size_t idx;
@ -981,6 +981,53 @@ static void displayItems(const struct linenoiseCompletions * lc, struct current
newLine(current);
}
char * update_current_buffer(struct current * current, size_t tmp_buf_len, char const * completion_buf, size_t completion_buf_size) {
size_t bytes_length = 0;
bytes_length = current->len - tmp_buf_len;
if(tmp_buf_len + completion_buf_size >= (size_t)current->bufmax) {
// at moment buffer is not modified
return NULL;
}
memset(current->buf + tmp_buf_len, '\0', bytes_length);
memcpy(current->buf + tmp_buf_len, completion_buf, completion_buf_size);
current->len = strlen(current->buf);
current->buf[current->bufmax - 1] = 0;
current->len = strlen(current->buf);
current->pos = current->chars = utf8_strlen(current->buf, current->len);
return current->buf;
}
/**
* computes the last string after a semicolon or a white space (toke separators)
* when the string does not contain token separators the quite string buffer
* of the current struct is returned
* @param current is the current edited buffer
* @param token_buf will point to the begin of the token
* @param token_length is optional, when the pointer is not null will contain the
* length of the token
*/
void last_token(struct current const * current, char ** token_buf, size_t * token_length) {
char * buf = current->buf + current->len-1;
size_t bytes_length = 0;
while((buf > current->buf) && ((*buf != ';') && (*buf != ' '))) {
buf--;
bytes_length++;
}
if(buf == current->buf) {
bytes_length++;
}
if(token_length) {
*token_length = bytes_length;
}
*token_buf = buf;
}
char * update_completion_buffer(struct current * current, char const * completion_buf, size_t completion_buf_size) {
char * buf = current->buf + current->len-1;
size_t bytes_length = 0;
last_token(current, &buf, &bytes_length);
return update_current_buffer(current, current->len - bytes_length, completion_buf, completion_buf_size);
}
static void refreshPage(const struct linenoiseCompletions * lc, struct current *current)
{
size_t j;
@ -988,7 +1035,7 @@ static void refreshPage(const struct linenoiseCompletions * lc, struct current *
size_t max_len = 0;
char * min_chars = NULL;
for(j=0; j<lc->len; j++) {
size_t j_len = utf8_strlen(lc->cvec[j], (int)strlen(lc->cvec[j]));
size_t j_len = utf8_strlen(lc->cvec[j], (int)strlen(lc->cvec[j]));
if(min_chars == NULL) {
min_chars = lc->cvec[j];
common_min_len = j_len;
@ -1015,12 +1062,11 @@ static void refreshPage(const struct linenoiseCompletions * lc, struct current *
newLine(current);
if(min_chars!=NULL) {
// char * new_buf = strndup(min_chars, common_min_len);
char * new_buf = malloc(common_min_len + 1);
memcpy(new_buf, min_chars, common_min_len);
new_buf[common_min_len] = '\0';
set_current(current, new_buf);
// this is posible because set_current copies the given pointer
free(new_buf);
char * updated_buf = update_completion_buffer(current, min_chars, common_min_len);
if(!updated_buf) {
printf(" Out of memory ");
return;
}
}
initLinenoiseLine(current);
refreshLine(current->prompt, current);
@ -1101,7 +1147,7 @@ static size_t new_line_numbers(size_t pos, struct current * current)
static int next_allowed_x(size_t pos, int cols, int pchars)
{
if (pos < cols - pchars)
if ((int)pos < cols - pchars)
{
return pos + pchars;
}
@ -1252,7 +1298,7 @@ static void set_current(struct current *current, const char *str)
static int has_room(struct current *current, int bytes)
{
return current->len + bytes < current->bufmax - 1;
return current->len + (size_t)bytes < (size_t)current->bufmax - 1;
}
/**
@ -1263,7 +1309,7 @@ static int has_room(struct current *current, int bytes)
*/
static int remove_char(struct current *current, size_t pos)
{
if (pos >= 0 && pos < current->chars) {
if (/*pos >= 0 &&*/ pos < (size_t)current->chars) {
int p1, p2;
int ret = 1;
p1 = utf8_index(current->buf, pos);
@ -1272,7 +1318,7 @@ static int remove_char(struct current *current, size_t pos)
#ifdef USE_TERMIOS
/* optimise remove char in the case of removing the last char */
if (current->pos == pos + 1 && current->pos == current->chars) {
if (current->buf[pos] >= ' ' && utf8_strlen(current->prompt, strlen(current->prompt)) + utf8_strlen(current->buf, current->len) < current->cols - 1) {
if (current->buf[pos] >= ' ' && utf8_strlen(current->prompt, strlen(current->prompt)) + utf8_strlen(current->buf, current->len) < (size_t)current->cols - 1) {
ret = 2;
fd_printf(current->fd, "\b \b");
}
@ -1298,12 +1344,12 @@ static int remove_char(struct current *current, size_t pos)
* Returns 1 if the line needs to be refreshed, 2 if not
* and 0 if nothing was inserted (no room)
*/
static int insert_char(struct current *current, size_t pos, int ch)
static int insert_char(struct current *current, int pos, int ch)
{
char buf[3] = {'\0','\0','\0'};
int n = utf8_getchars(buf, ch);
if (has_room(current, n) && pos >= 0 && pos <= current->chars) {
if ((size_t)has_room(current, n) && (pos >= 0) && (size_t)pos <= current->chars) {
int p1, p2;
int ret = 1;
p1 = utf8_index(current->buf, pos);
@ -1326,7 +1372,7 @@ static int insert_char(struct current *current, size_t pos, int ch)
current->len += n;
current->chars++;
if (current->pos >= pos) {
if ((int)current->pos >= pos) {
current->pos++;
}
return ret;
@ -1339,7 +1385,7 @@ static int insert_char(struct current *current, size_t pos, int ch)
*
* This replaces any existing characters in the cut buffer.
*/
static void capture_chars(struct current *current, size_t pos, size_t n)
static void capture_chars(struct current *current, int pos, size_t n)
{
if (pos >= 0 && (pos + n - 1) < current->chars) {
int p1 = utf8_index(current->buf, pos);
@ -1411,19 +1457,24 @@ static void freeCompletions(linenoiseCompletions *lc) {
free(lc->cvec);
}
static int completeLine(struct current *current) {
linenoiseCompletions lc = { 0, NULL, 0 };
int c = 0;
completionCallback(current->buf,&lc);
char * buf = NULL;
last_token(current, &buf, NULL);
if(buf && (buf != current->buf)) {
buf++;
}
completionCallback(buf,&lc);
if (lc.len == 0) {
beep();
} else {
size_t stop = 0, i = 0;
if(lc.len>1 && lc.multiLine) {
if(lc.len>=1 && lc.multiLine) {
refreshPage(&lc, current);
freeCompletions(&lc);
return c;
return c;
}
stop = 0, i = 0;
@ -1830,8 +1881,8 @@ history_navigation:
refreshLine(current->prompt, current);
break;
default:
/* Only tab is allowed without ^V */
if (c == '\t' || c >= ' ') {
/* Only characters greater than white space are allowed */
if (c >= ' ') {
eraseEol(current);
// if (insert_char(current, current->pos, c) == 1) {
insert_char(current, current->pos, c);
@ -1854,7 +1905,7 @@ int linenoiseColumns(void)
}
char *linenoise(const char *prompt)
{
size_t count;
int count;
struct current current;
char buf[LINENOISE_MAX_LINE];

View File

@ -1,34 +1,22 @@
!CHAPTER Collection Methods
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_drop
!SUBSECTION Drop
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionDrop
`collection.truncate()`
!SUBSECTION Truncate
<!-- js/server/modules/org/arangodb/arango-collection.js-->
@startDocuBlock collectionTruncate
Truncates a collection, removing all documents but keeping all its indexes.
!SUBSECTION Properties
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionProperties
*Examples*
Truncates a collection:
```
arango> col = db.examples;
[ArangoCollection 91022, "examples" (status new born)]
arango> col.save({ "Hello" : "World" });
{ "_id" : "91022/1532814", "_rev" : 1532814 }
arango> col.count();
1
arango> col.truncate();
arango> col.count();
0
```
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_properties
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_figures
!SUBSECTION Figures
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionFigures
!SUBSECTION Reserve
`collection.reserve( number)`
Sends a resize hint to the indexes in the collection. The resize hint allows indexes to reserve space for additional documents (specified by number) in one go.
@ -37,63 +25,22 @@ The reserve hint can be sent before a mass insertion into the collection is star
Not all indexes implement the reserve function at the moment. The indexes that don't implement it will simply ignore the request. returns the revision id of a collection
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_revision
!SUBSECTION Revision
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionRevision
`collection.checksum( withRevisions, withData)`
!SUBSECTION Checksum
<!-- arangod/V8-Server/v8-query.cpp -->
@startDocuBlock collectionChecksum
The checksum operation calculates a CRC32 checksum of the keys contained in collection collection.
!SUBSECTION Unload
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionUnload
If the optional argument withRevisions is set to true, then the revision ids of the documents are also included in the checksumming.
!SUBSECTION Rename
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionRename
If the optional argument withData is set to true, then the actual document data is also checksummed. Including the document data in checksumming will make the calculation slower, but is more accurate.
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_unload
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_rename
<!-- v8-vocbase.cpp -->
@startDocuBlock collection_rotate
<!--
@anchor HandlingCollectionsDrop
@copydetails JS_DropVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsTruncate
@copydetails JSF_ArangoCollection_prototype_truncate
@CLEARPAGE
@anchor HandlingCollectionsProperties
@copydetails JS_PropertiesVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsFigures
@copydetails JS_FiguresVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsLoad
@copydetails JS_LoadVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsRevision
@copydetails JS_RevisionVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsChecksum
@copydetails JS_ChecksumCollection
@CLEARPAGE
@anchor HandlingCollectionsUnload
@copydetails JS_UnloadVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsRename
@copydetails JS_RenameVocbaseCol
@CLEARPAGE
@anchor HandlingCollectionsRotate
@copydetails JS_RotateVocbaseCol
-->
!SUBSECTION Rotate
<!-- arangod/V8-Server/v8-vocbase.cpp -->
@startDocuBlock collectionRotate

View File

@ -5,10 +5,6 @@ collections from the JavaScript shell _arangosh_. For other languages see the
corresponding language API.
The most import call is the call to create a new collection
<!--
, see @ref HandlingCollectionsCreate "db._create".
-->
!SECTION Address of a Collection
@ -19,7 +15,7 @@ no control over it. In order to allow users to use their own names, each collect
also has an unique name which is specified by the user. To access a collection
from the user perspective, the collection name should be used, i.e.:
`db._collection(collection-name)``
`db._collection(collection-name)`
A collection is created by a ["db._create"](../Collections/DatabaseMethods.md) call.
@ -32,12 +28,12 @@ If no collection with such a name exists, then *null* is returned.
There is a short-cut that can be used for non-system collections:
*db.collection-name*
`db.collection-name`
This call will either return the collection named *db.collection-name* or create
a new one with that name and a set of default properties.
Note: Creating a collection on the fly using *db.collection-name* is
**Note**: Creating a collection on the fly using *db.collection-name* is
not recommend and does not work in _arangosh_. To create a new collection, please
use

View File

@ -6,34 +6,34 @@ The following methods are available to manage databases via JavaScript.
Please note that several of these methods can be used from the _system
database only.
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_name
@startDocuBlock databaseName
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_id
@startDocuBlock databaseId
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_path
@startDocuBlock databasePath
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_isSystem
@startDocuBlock databaseIsSystem
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_useDatabase
@startDocuBlock databaseUseDatabase
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_listDatabase
@startDocuBlock databaseListDatabase
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_createDatabase
@startDocuBlock databaseCreateDatabase
<!-- v8-vocbase.cpp -->
<!-- arangod/V8Server/v8-vocbase.cpp -->
@startDocuBlock database_dropDatabase
@startDocuBlock databaseDropDatabase

View File

@ -30,7 +30,7 @@ The edge definitions for a graph is an Array containing arbitrary many directed
Each graph can have an arbitrary amount of orphan collections. These are vertex collections (type *document*), that are not
used in an edge definition of the graph. If the graph is extended with an edge definition using one of the orphans,
it will be removed from the orphan collection automatically.
it will be removed from the set of orphan collection automatically.
!SUBSUBSECTION Add

View File

@ -27,8 +27,8 @@ def getTextFromSourceFile(searchText, full_path):
if match:
textExtracted = match.group(1)
textExtracted = textExtracted.replace("<br />","\n")
textExtracted = re.sub(r"@RESTHEADER{(.*)}", r"`\g<1>`", textExtracted)
textExtracted = re.sub(r"@RESTRETURNCODE{(.*)}", r"`HTTP \g<1>`", textExtracted)
textExtracted = re.sub(r"@RESTHEADER{(.*)}", r"*\g<1>*", textExtracted)
textExtracted = re.sub(r"@RESTRETURNCODE{(.*)}", r"*HTTP \g<1>*", textExtracted)
textExtracted = re.sub(r"@RESTBODYPARAM{(.*)}", r"*(\g<1>)*", textExtracted)
textExtracted = textExtracted.replace("@RESTDESCRIPTION","")
textExtracted = textExtracted.replace("@EXAMPLES","*Examples*")

View File

@ -353,6 +353,7 @@ examples:
@srcdir@/js/apps/system/gharial \
@srcdir@/Documentation/Books/Users \
@srcdir@/arangod/RestHandler \
@srcdir@/arangod/V8Server \
@srcdir@/lib/Admin \
> /tmp/arangosh.examples

View File

@ -241,13 +241,13 @@ arangosysconf_DATA = $(shell find @builddir@/etc/arangodb -name "*$(PROGRAM_SUFF
### @brief /share data
################################################################################
pkgdataACTIONSdir = $(datadir)
pkgdataCOMMONdir = $(datadir)
pkgdataSERVERdir = $(datadir)
pkgdataCLIENTdir = $(datadir)
pkgdataNODEdir = $(datadir)
pkgdataAPPSdir = $(datadir)
pkgdataMRUBYdir = $(datadir)
pkgdataACTIONSdir = $(datadir)/arangodb
pkgdataCOMMONdir = $(datadir)/arangodb
pkgdataSERVERdir = $(datadir)/arangodb
pkgdataCLIENTdir = $(datadir)/arangodb
pkgdataNODEdir = $(datadir)/arangodb
pkgdataAPPSdir = $(datadir)/arangodb
pkgdataMRUBYdir = $(datadir)/arangodb
nobase_pkgdata_DATA =

View File

@ -2216,7 +2216,7 @@ template<bool WR, bool WD> static bool ChecksumCalculator (TRI_doc_mptr_t const*
////////////////////////////////////////////////////////////////////////////////
/// @brief calculates a checksum for the data in a collection
/// @startDocuBlock collection_checksum
/// @startDocuBlock collectionChecksum
/// `collection.checksum(withRevisions, withData)`
///
/// The *checksum* operation calculates a CRC32 checksum of the keys
@ -2229,7 +2229,8 @@ template<bool WR, bool WD> static bool ChecksumCalculator (TRI_doc_mptr_t const*
/// actual document data is also checksummed. Including the document data in
/// checksumming will make the calculation slower, but is more accurate.
///
/// Note: this method is not available in a cluster.
/// **Note**: this method is not available in a cluster.
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -2320,21 +2321,22 @@ static v8::Handle<v8::Value> JS_ChecksumCollection (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief selects all edges for a set of vertices
/// @startDocuBlock edgeCollectionEdges
/// `edge-collection.edges(vertex)`
///
/// @FUN{@FA{edge-collection}.edges(@FA{vertex})}
/// The *edges* operator finds all edges starting from (outbound) or ending
/// in (inbound) *vertex*.
///
/// The @FN{edges} operator finds all edges starting from (outbound) or ending
/// in (inbound) @FA{vertex}.
/// `edge-collection.edges(vertices)`
///
/// @FUN{@FA{edge-collection}.edges(@FA{vertices})}
///
/// The @FN{edges} operator finds all edges starting from (outbound) or ending
/// in (inbound) a document from @FA{vertices}, which must a list of documents
/// The *edges* operator finds all edges starting from (outbound) or ending
/// in (inbound) a document from *vertices*, which must a list of documents
/// or document handles.
///
/// @EXAMPLES
///
/// @verbinclude shell-edge-edges
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
static v8::Handle<v8::Value> JS_EdgesQuery (v8::Arguments const& argv) {
@ -2343,7 +2345,7 @@ static v8::Handle<v8::Value> JS_EdgesQuery (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief selects all inbound edges
///
/// @startDocuBlock edgeCollectionInEdges
/// @FUN{@FA{edge-collection}.inEdges(@FA{vertex})}
///
/// The @FN{edges} operator finds all edges ending in (inbound) @FA{vertex}.
@ -2356,6 +2358,7 @@ static v8::Handle<v8::Value> JS_EdgesQuery (v8::Arguments const& argv) {
/// @EXAMPLES
///
/// @verbinclude shell-edge-in-edges
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
static v8::Handle<v8::Value> JS_InEdgesQuery (v8::Arguments const& argv) {
@ -2535,24 +2538,25 @@ static v8::Handle<v8::Value> FulltextQuery (V8ReadTransaction& trx,
////////////////////////////////////////////////////////////////////////////////
/// @brief queries the fulltext index
/// @startDocuBlock collectionFulltext
/// `collection.FULLTEXT(index-handle, query)`
///
/// @FUN{@FA{collection}.FULLTEXT(@FA{index-handle}, @FA{query})}
/// The *FULLTEXT* operator performs a fulltext search using the specified
/// index and the specified *query*.
///
/// The @FN{FULLTEXT} operator performs a fulltext search using the specified
/// index and the specified @FA{query}.
///
/// @FA{query} must contain a comma-separated list of words to look for.
/// *query* must contain a comma-separated list of words to look for.
/// Each word can optionally be prefixed with one of the following command
/// literals:
/// - @LIT{prefix}: perform a prefix-search for the word following
/// - @LIT{substring}: perform substring-matching for the word following. This
/// - *prefix*: perform a prefix-search for the word following
/// - *substring*: perform substring-matching for the word following. This
/// option is only supported for fulltext indexes that have been created with
/// the @LIT{indexSubstrings} option
/// - @LIT{complete}: only match the complete following word (this is the default)
/// the *indexSubstrings* option
/// - *complete*: only match the complete following word (this is the default)
///
/// @EXAMPLES
///
/// @verbinclude shell-simple-fulltext
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
static v8::Handle<v8::Value> JS_FulltextQuery (v8::Arguments const& argv) {
@ -2779,20 +2783,21 @@ static v8::Handle<v8::Value> JS_NearQuery (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief selects all outbound edges
/// @startDocuBlock edgeCollectionOutEdges
/// `edge-collection.outEdges(vertex)`
///
/// @FUN{@FA{edge-collection}.outEdges(@FA{vertex})}
/// The *edges* operator finds all edges starting from (outbound)
/// *vertices*.
///
/// The @FN{edges} operator finds all edges starting from (outbound)
/// @FA{vertices}.
/// `edge-collection.outEdges(vertices)`
///
/// @FUN{@FA{edge-collection}.outEdges(@FA{vertices})}
///
/// The @FN{edges} operator finds all edges starting from (outbound) a document
/// from @FA{vertices}, which must a list of documents or document handles.
/// The *edges* operator finds all edges starting from (outbound) a document
/// from *vertices*, which must a list of documents or document handles.
///
/// @EXAMPLES
///
/// @verbinclude shell-edge-out-edges
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
static v8::Handle<v8::Value> JS_OutEdgesQuery (v8::Arguments const& argv) {

View File

@ -5536,7 +5536,7 @@ static v8::Handle<v8::Value> JS_DatafileScanVocbaseCol (v8::Arguments const& arg
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that an index exists
/// @startDocuBlock col_ensureIndex
/// @startDocuBlock collectionEnsureIndex
/// `collection.ensureIndex(index-description)
///
/// Ensures that an index according to the *index-description* exists. A
@ -5595,7 +5595,7 @@ static v8::Handle<v8::Value> JS_LookupIndexVocbaseCol (v8::Arguments const& argv
////////////////////////////////////////////////////////////////////////////////
/// @brief counts the number of documents in a result set
/// @startDocuBlock col_count
/// @startDocuBlock colllectionCount
/// `collection.count()`
///
/// Returns the number of living documents in the collection.
@ -5659,7 +5659,7 @@ static v8::Handle<v8::Value> JS_CountVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief returns information about the datafiles
/// @startDocuBlock col_datafiles
/// @startDocuBlock collectionDatafiles
/// `collection.datafiles()`
///
/// Returns information about the datafiles. The collection must be unloaded.
@ -5725,7 +5725,7 @@ static v8::Handle<v8::Value> JS_DatafilesVocbaseCol (v8::Arguments const& argv)
////////////////////////////////////////////////////////////////////////////////
/// @brief looks up a document
/// @startDocuBlock documents_collectionName
/// @startDocuBlock documentsCollectionName
/// `collection.document(document)`
///
/// The *document* method finds a document given its identifier or a document
@ -5813,14 +5813,22 @@ static v8::Handle<v8::Value> DropVocbaseColCoordinator (TRI_vocbase_col_t* colle
////////////////////////////////////////////////////////////////////////////////
/// @brief drops a collection
/// @startDocuBlock collection_drop
/// @startDocuBlock collectionDrop
/// `collection.drop()`
///
/// Drops a *collection* and all its indexes.
///
/// @EXAMPLES
///
/// @verbinclude shell_collection-drop
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionDrop}
/// ~ db._create("examples");
/// col = db.examples;
/// col.drop();
/// col;
/// ~ db._drop("examples");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
static v8::Handle<v8::Value> JS_DropVocbaseCol (v8::Arguments const& argv) {
@ -5981,7 +5989,7 @@ static v8::Handle<v8::Value> JS_DropIndexVocbaseCol (v8::Arguments const& argv)
////////////////////////////////////////////////////////////////////////////////
/// @brief checks whether a document exists
/// @startDocuBlock documents_collectionExists
/// @startDocuBlock documentsCollectionExists
/// `collection.exists(document)`
///
/// The *exists* method determines whether a document exists given its
@ -6063,7 +6071,7 @@ static TRI_doc_collection_info_t* GetFigures (TRI_vocbase_col_t* collection) {
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the figures of a collection
/// @startDocuBlock collection_figures
/// @startDocuBlock collectionFigures
/// `collection.figures()`
///
/// Returns an object containing all collection figures.
@ -6112,6 +6120,7 @@ static TRI_doc_collection_info_t* GetFigures (TRI_vocbase_col_t* collection) {
/// *Examples*
///
/// @verbinclude shell_collection-figures
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -6248,7 +6257,7 @@ static v8::Handle<v8::Value> GetIndexesCoordinator (TRI_vocbase_col_t const* col
////////////////////////////////////////////////////////////////////////////////
/// @brief returns information about the indexes
/// @startDocuBlock col_getIndexes
/// @startDocuBlock collectionGetIndexes
/// @FUN{getIndexes()}
///
/// Returns a list of all indexes defined for the collection.
@ -6316,7 +6325,7 @@ static v8::Handle<v8::Value> JS_GetIndexesVocbaseCol (v8::Arguments const& argv)
////////////////////////////////////////////////////////////////////////////////
/// @brief loads a collection
/// @startDocuBlock collection_load
/// @startDocuBlock collectionLoad
/// `collection.load()`
///
/// Loads a collection into memory.
@ -6417,7 +6426,7 @@ static v8::Handle<v8::Value> JS_PlanIdVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief gets or sets the properties of a collection
/// @startDocuBlock collection_properties
/// @startDocuBlock collectionProperties
/// `collection.properties()`
///
/// Returns an object containing all collection properties.
@ -6474,11 +6483,20 @@ static v8::Handle<v8::Value> JS_PlanIdVocbaseCol (v8::Arguments const& argv) {
///
/// Read all properties
///
/// @verbinclude shell_collection-properties
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionProperties}
/// ~ db._create("examples");
/// db.examples.properties();
/// ~ db._drop("examples");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// Change a property
///
/// @verbinclude shell_collection-properties-change
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionProperty}
/// ~ db._create("examples");
/// db.examples.properties({ waitForSync : false });
/// ~ db._drop("examples");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -6707,7 +6725,7 @@ static v8::Handle<v8::Value> JS_PropertiesVocbaseCol (v8::Arguments const& argv)
////////////////////////////////////////////////////////////////////////////////
/// @brief removes a document
/// @startDocuBlock documents_documentRemove
/// @startDocuBlock documentsDocumentRemove
/// `collection.remove(document)`
///
/// Removes a document. If there is revision mismatch, then an error is thrown.
@ -6781,7 +6799,7 @@ static v8::Handle<v8::Value> JS_RemoveVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief renames a collection
/// @startDocuBlock collection_rename
/// @startDocuBlock collectionRename
/// `collection.rename(new-name)`
///
/// Renames a collection using the *new-name*. The *new-name* must not
@ -6791,11 +6809,12 @@ static v8::Handle<v8::Value> JS_RemoveVocbaseCol (v8::Arguments const& argv) {
///
/// If renaming fails for any reason, an error is thrown.
///
/// Note: this method is not available in a cluster.
/// **Note**: this method is not available in a cluster.
///
/// @EXAMPLES
///
/// @verbinclude shell_collection-rename
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -6853,7 +6872,7 @@ static v8::Handle<v8::Value> JS_RenameVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief replaces a document
/// @startDocuBlock documents_collectionReplace
/// @startDocuBlock documentsCollectionReplace
/// `collection.replace(document, data)`
///
/// Replaces an existing *document*. The *document* must be a document in
@ -6953,7 +6972,7 @@ static int GetRevisionCoordinator (TRI_vocbase_col_t* collection,
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the revision id of a collection
/// @startDocuBlock collection_load
/// @startDocuBlock collectionLoad
/// `collection.revision()`
///
/// Returns the revision id of the collection
@ -6998,7 +7017,7 @@ static v8::Handle<v8::Value> JS_RevisionVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief rotates the current journal of a collection
/// @startDocuBlock collection_rotate
/// @startDocuBlock collectionRotate
/// `collection.rotate()`
///
/// Rotates the current journal of a collection (i.e. makes the journal a
@ -7006,7 +7025,8 @@ static v8::Handle<v8::Value> JS_RevisionVocbaseCol (v8::Arguments const& argv) {
/// datafile in a following compaction run and perform earlier garbage
/// collection.
///
/// Note: this method is not available in a cluster.
/// **Note**: this method is not available in a cluster.
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -7044,7 +7064,7 @@ static v8::Handle<v8::Value> JS_RotateVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief updates a document
/// @startDocuBlock documents_collectionUpdate
/// @startDocuBlock documentsCollectionUpdate
/// `collection.update(document, data, overwrite, keepNull, waitForSync)` or
/// `collection.update(document, data,
/// overwrite: true or false, keepNull: true or false, waitForSync: true or false)`
@ -7280,7 +7300,7 @@ static v8::Handle<v8::Value> SaveEdgeColCoordinator (TRI_vocbase_col_t* collecti
////////////////////////////////////////////////////////////////////////////////
/// @brief saves a new document
/// @startDocuBlock documents_collectionSave
/// @startDocuBlock documentsCollectionSave
/// `collection.save(data)`
///
/// Creates a new document in the *collection* from the given *data*. The
@ -7464,7 +7484,7 @@ static v8::Handle<v8::Value> JS_TruncateDatafileVocbaseCol (v8::Arguments const&
////////////////////////////////////////////////////////////////////////////////
/// @brief returns the type of a collection
/// @startDocuBlock col_type
/// @startDocuBlock collectionType
/// `collection.type()`
///
/// Returns the type of a collection. Possible values are:
@ -7505,7 +7525,7 @@ static v8::Handle<v8::Value> JS_TypeVocbaseCol (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief unloads a collection
/// @startDocuBlock collection_unload
/// @startDocuBlock collectionUnload
/// `collection.unload()`
///
/// Starts unloading a collection from memory. Note that unloading is deferred
@ -7514,6 +7534,7 @@ static v8::Handle<v8::Value> JS_TypeVocbaseCol (v8::Arguments const& argv) {
/// @EXAMPLES
///
/// @verbinclude shell_collection-unload
///
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -7602,7 +7623,7 @@ static v8::Handle<v8::Object> WrapVocBase (TRI_vocbase_t const* database) {
////////////////////////////////////////////////////////////////////////////////
/// @brief selects a collection from the vocbase
/// @startDocuBlock collection_databaseCollectionName
/// @startDocuBlock collectionDatabaseCollectionName
/// `db.collection-name`
///
/// Returns the collection with the given *collection-name*. If no such
@ -7838,7 +7859,7 @@ static TRI_vocbase_col_t* GetCollectionFromArgument (TRI_vocbase_t* vocbase,
////////////////////////////////////////////////////////////////////////////////
/// @brief returns a single collection or null
/// @startDocuBlock collection_databaseName
/// @startDocuBlock collectionDatabaseName
/// `db._collection(collection-name)`
///
/// Returns the collection with the given name or null if no such collection
@ -7914,7 +7935,7 @@ static v8::Handle<v8::Value> JS_CollectionVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief returns all collections
/// @startDocuBlock collections_databaseName
/// @startDocuBlock collectionsDatabaseName
/// `db._collections()`
///
/// Returns all collections of the given database.
@ -8043,7 +8064,7 @@ static v8::Handle<v8::Value> JS_CompletionsVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new document or edge collection
/// @startDocuBlock collection_databaseCreate
/// @startDocuBlock collectionDatabaseCreate
/// `db._create(collection-name)`
///
/// Creates a new document collection named *collection-name*.
@ -8146,7 +8167,7 @@ static v8::Handle<v8::Value> JS_CreateVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new document collection
/// @startDocuBlock col_createDocumentaion
/// @startDocuBlock collectionCreateDocumentaion
/// `db._createDocumentCollection(collection-name)`
///
/// `db._createDocumentCollection(collection-name, properties)`
@ -8163,7 +8184,7 @@ static v8::Handle<v8::Value> JS_CreateDocumentCollectionVocbase (v8::Arguments c
////////////////////////////////////////////////////////////////////////////////
/// @brief creates a new edge collection
/// @startDocuBlock col_createEdgeCollection
/// @startDocuBlock collectionCreateEdgeCollection
/// `db._createEdgeCollection(collection-name)`
///
/// Creates a new edge collection named *collection-name*. If the
@ -8193,7 +8214,7 @@ static v8::Handle<v8::Value> JS_CreateEdgeCollectionVocbase (v8::Arguments const
////////////////////////////////////////////////////////////////////////////////
/// @brief removes a document
/// @startDocuBlock documents_collectionRemove
/// @startDocuBlock documentsCollectionRemove
/// `db._remove(document)`
///
/// Removes a document. If there is revision mismatch, then an error is thrown.
@ -8280,7 +8301,7 @@ static v8::Handle<v8::Value> JS_RemoveVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief looks up a document and returns it
/// @startDocuBlock documents_documentName
/// @startDocuBlock documentsDocumentName
/// `db._document(document)`
///
/// This method finds a document given its identifier. It returns the document
@ -8315,7 +8336,7 @@ static v8::Handle<v8::Value> JS_DocumentVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief checks whether a document exists
/// @startDocuBlock documents_documentExists
/// @startDocuBlock documentsDocumentExists
/// `db._exists(document)`
///
/// This method determines whether a document exists given its identifier.
@ -8340,7 +8361,7 @@ static v8::Handle<v8::Value> JS_ExistsVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief replaces a document
/// @startDocuBlock documents_documentReplace
/// @startDocuBlock documentsDocumentReplace
/// `db._replace(document, data)`
///
/// The method returns a document with the attributes *_id*, *_rev* and
@ -8389,7 +8410,7 @@ static v8::Handle<v8::Value> JS_ReplaceVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief update a document
/// @startDocuBlock documents_documentUpdate
/// @startDocuBlock documentsDocumentUpdate
/// `db._update(document, data, overwrite, keepNull, waitForSync)`
///
/// Updates an existing *document*. The *document* must be a document in
@ -8446,7 +8467,7 @@ static v8::Handle<v8::Value> JS_UpdateVocbase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief return the server version string
/// @startDocuBlock
/// @startDocuBlock databaseVersion
/// `db._version()`
///
/// Returns the server version string.
@ -8461,7 +8482,7 @@ static v8::Handle<v8::Value> JS_VersionServer (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief return the path to database files
/// @startDocuBlock database_path
/// @startDocuBlock databasePath
/// `db._path()`
///
/// Returns the filesystem path of the current database as a string.
@ -8482,7 +8503,7 @@ static v8::Handle<v8::Value> JS_PathDatabase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief return the database id
/// @startDocuBlock database_id
/// @startDocuBlock databaseId
/// `db._id()`
///
/// Returns the id of the current database as a string.
@ -8503,7 +8524,7 @@ static v8::Handle<v8::Value> JS_IdDatabase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief return the database name
/// @startDocuBlock database_name
/// @startDocuBlock databaseName
/// `db._name()`
///
/// Returns the name of the current database as a string.
@ -8524,7 +8545,7 @@ static v8::Handle<v8::Value> JS_NameDatabase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief return the database type
/// @startDocuBlock database_isSystem
/// @startDocuBlock databaseIsSystem
/// `db._isSystem()`
///
/// Returns whether the currently used database is the *_system* database.
@ -8549,7 +8570,7 @@ static v8::Handle<v8::Value> JS_IsSystemDatabase (v8::Arguments const& argv) {
////////////////////////////////////////////////////////////////////////////////
/// @brief change the current database
/// @startDocuBlock database_useDatabase
/// @startDocuBlock databaseUseDatabase
/// `db._useDatabase(name)`
///
/// Changes the current database to the database specified by *name*. Note
@ -8692,7 +8713,7 @@ static v8::Handle<v8::Value> ListDatabasesCoordinator (v8::Arguments const& argv
////////////////////////////////////////////////////////////////////////////////
/// @brief return the list of all existing databases
/// @startDocuBlock database_listDatabase
/// @startDocuBlock databaseListDatabase
/// `db._listDatabases()`
///
/// Returns the list of all databases. This method can only be used from within
@ -8856,7 +8877,7 @@ static v8::Handle<v8::Value> CreateDatabaseCoordinator (v8::Arguments const& arg
////////////////////////////////////////////////////////////////////////////////
/// @brief create a new database
/// @startDocuBlock database_createDatabase
/// @startDocuBlock databaseCreateDatabase
/// `db._createDatabase(name, options, users)`
///
/// Creates a new database with the name specified by *name*.
@ -9052,13 +9073,13 @@ static v8::Handle<v8::Value> DropDatabaseCoordinator (v8::Arguments const& argv)
////////////////////////////////////////////////////////////////////////////////
/// @brief drop an existing database
/// @startDocuBlock database_dropDatabase
/// @startDocuBlock databaseDropDatabase
/// `db._dropDatabase(name)`
///
/// Drops the database specified by *name*. The database specified by
/// *name* must exist.
///
/// Note that dropping databases is only possible from within the *_system*
/// **Note**: Dropping databases is only possible from within the *_system*
/// database. The *_system* database itself cannot be dropped.
///
/// Databases are dropped asynchronously, and will be physically removed if

View File

@ -1556,7 +1556,7 @@ var _extendEdgeDefinitions = function (edgeDefinition) {
///
/// * *graphName*: Unique identifier of the graph
/// * *edgeDefinitions* (optional): List of relation definition objects
/// * *orphanCollections* (optional): List of additonal vertex collection names
/// * *orphanCollections* (optional): List of additional vertex collection names
///
/// *Examples*
///
@ -3079,7 +3079,7 @@ Graph.prototype._eccentricity = function(options) {
/// *of the vertices defined by the examples.*
///
/// The function accepts an id, an example, a list of examples or even an empty
/// example as parameter for vertexExample.
/// example as parameter for *vertexExample*.
///
/// *Parameter*
///
@ -3123,7 +3123,7 @@ Graph.prototype._eccentricity = function(options) {
/// g._absoluteCloseness({}, {weight : 'distance'});
/// @END_EXAMPLE_ARANGOSH_OUTPUT
///
/// A route planner example, the absolute closeness of all germanCities regarding only
/// A route planner example, the absolute closeness of all german Cities regarding only
/// outbound paths.
///
/// @EXAMPLE_ARANGOSH_OUTPUT{generalGraphModuleAbsCloseness3}

View File

@ -98,7 +98,7 @@
/// @EXAMPLE_ARANGOSH_RUN{HttpGharialCreate}
/// var graph = require("org/arangodb/general-graph");
/// | if (graph._exists("myGraph")) {
/// | graph._drop("myGraph");
/// | graph._drop("myGraph", true);
/// }
/// var url = "/_api/gharial";
/// body = {
@ -110,7 +110,7 @@
/// }]
/// };
///
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
/// var response = logCurlRequest('POST', url, body);
///
/// assert(response.code === 201);
///
@ -232,7 +232,7 @@
/// body = {
/// collection: "otherVertices"
/// };
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
/// var response = logCurlRequest('POST', url, body);
///
/// assert(response.code === 201);
///
@ -378,7 +378,7 @@
/// from: ["female", "male"],
/// to: ["city"]
/// };
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
/// var response = logCurlRequest('POST', url, body);
///
/// assert(response.code === 201);
///
@ -429,7 +429,7 @@
/// from: ["female", "male", "animal"],
/// to: ["female", "male", "animal"]
/// };
/// var response = logCurlRequest('PUT', url, JSON.stringify(body));
/// var response = logCurlRequest('PUT', url, body);
///
/// assert(response.code === 200);
///
@ -538,7 +538,7 @@
/// body = {
/// name: "Francis"
/// }
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
/// var response = logCurlRequest('POST', url, body);
///
/// assert(response.code === 201);
///
@ -629,7 +629,7 @@
/// age: 26
/// }
/// var url = "/_api/gharial/social/vertex/female/alice";
/// var response = logCurlRequest('PUT', url, JSON.stringify(body));
/// var response = logCurlRequest('PUT', url, body);
///
/// assert(response.code === 200);
///
@ -685,7 +685,7 @@
/// age: 26
/// }
/// var url = "/_api/gharial/social/vertex/female/alice";
/// var response = logCurlRequest('PATCH', url, JSON.stringify(body));
/// var response = logCurlRequest('PATCH', url, body);
///
/// assert(response.code === 200);
///
@ -796,7 +796,7 @@
/// _from: "female/alice",
/// _to: "female/diana"
/// };
/// var response = logCurlRequest('POST', url, JSON.stringify(body));
/// var response = logCurlRequest('POST', url, body);
///
/// assert(response.code === 201);
///
@ -904,7 +904,7 @@
/// body = {
/// type: "divorced"
/// }
/// var response = logCurlRequest('PUT', url, JSON.stringify(body));
/// var response = logCurlRequest('PUT', url, body);
///
/// assert(response.code === 200);
///
@ -959,7 +959,7 @@
/// body = {
/// since: "01.01.2001"
/// }
/// var response = logCurlRequest('PATCH', url, JSON.stringify(body));
/// var response = logCurlRequest('PATCH', url, body);
///
/// assert(response.code === 200);
///

File diff suppressed because it is too large Load Diff

View File

@ -83,25 +83,25 @@ ArangoCollection.prototype.toArray = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief truncates a collection
/// @startDocuBlock collection_truncates
/// @startDocuBlock collectionTruncate
/// `collection.truncate()`
///
/// Truncates a *collection*, removing all documents but keeping all its
/// indexes.
///
/// *Examples*
/// @EXAMPLES
///
/// Truncates a collection:
///
/// arango> col = db.examples;
/// [ArangoCollection 91022, "examples" (status new born)]
/// arango> col.save({ "Hello" : "World" });
/// { "_id" : "91022/1532814", "_rev" : 1532814 }
/// arango> col.count();
/// 1
/// arango> col.truncate();
/// arango> col.count();
/// 0
/// @EXAMPLE_ARANGOSH_OUTPUT{collectionTruncate}
/// ~ db._create("examples");
/// col = db.examples;
/// col.save({ "Hello" : "World" });
/// col.count();
/// col.truncate();
/// col.count();
/// ~ db._drop("examples");
/// @END_EXAMPLE_ARANGOSH_OUTPUT
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
@ -337,7 +337,7 @@ ArangoCollection.prototype.any = function () {
/// @fn JSF_ArangoCollection_prototype_first
///
/// @brief selects the n first documents in the collection
/// @startDocuBlock documents_collectionFirst
/// @startDocuBlock documentsCollectionFirst
/// `collection.first(count)`
///
/// The *first* method returns the n first documents from the collection, in
@ -419,7 +419,7 @@ ArangoCollection.prototype.first = function (count) {
/// @fn JSF_ArangoCollection_prototype_last
///
/// @brief selects the n last documents in the collection
/// @startDocuBlock documents_collectionLast
/// @startDocuBlock documentsCollectionLast
/// `collection.last(count)`
///
/// The *last* method returns the n last documents from the collection, in
@ -884,18 +884,18 @@ ArangoCollection.prototype.updateByExample = function (example,
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a bitarray index exists
///
/// @FUN{@FA{collection}.ensureBitarray(@FA{field1}, @FA{value1}, ..., @FA{fieldn}, @FA{valuen})}
/// @startDocuBlock collectionEnsureBitArray
/// `collection.ensureBitarray(field*1*, value*1*, ..., field*n*, value*n*)`
///
/// Creates a bitarray index on documents using attributes as paths to the
/// fields (@FA{field1},..., @FA{fieldn}). A value (@FA{value1},...,@FA{valuen})
/// fields (*field1*,..., *fieldn*}). A value (*value1*,...,*valuen*)
/// consists of an array of possible values that the field can take. At least
/// one field and one set of possible values must be given.
///
/// All documents, which do not have *all* of the attribute paths are ignored
/// (that is, are not part of the bitarray index, they are however stored within
/// the collection). A document which contains all of the attribute paths yet
/// has one or more values which are *not* part of the defined range of values
/// has one or more values which are **not** part of the defined range of values
/// will be rejected and the document will not inserted within the
/// collection. Note that, if a bitarray index is created subsequent to
/// any documents inserted in the given collection, then the creation of the
@ -906,10 +906,10 @@ ArangoCollection.prototype.updateByExample = function (example,
/// returned.
///
/// In the example below we create a bitarray index with one field and that
/// field can have the values of either `0` or `1`. Any document which has the
/// attribute `x` defined and does not have a value of `0` or `1` will be
/// field can have the values of either *0* or *1*. Any document which has the
/// attribute *x* defined and does not have a value of *0* or *1* will be
/// rejected and therefore not inserted within the collection. Documents without
/// the attribute `x` defined will not take part in the index.
/// the attribute *x* defined will not take part in the index.
///
/// @code
/// arango> arangod> db.example.ensureBitarray("x", [0,1]);
@ -924,9 +924,9 @@ ArangoCollection.prototype.updateByExample = function (example,
/// @endcode
///
/// In the example below we create a bitarray index with one field and that
/// field can have the values of either `0`, `1` or *other* (indicated by
/// `[]`). Any document which has the attribute `x` defined will take part in
/// the index. Documents without the attribute `x` defined will not take part in
/// field can have the values of either *0*, *1* or *other* (indicated by
/// *[]*). Any document which has the attribute *x* defined will take part in
/// the index. Documents without the attribute *x* defined will not take part in
/// the index.
///
/// @code
@ -941,12 +941,12 @@ ArangoCollection.prototype.updateByExample = function (example,
/// }
/// @endcode
///
/// In the example below we create a bitarray index with two fields. Field `x`
/// can have the values of either `0` or `1`; while field `y` can have the values
/// of `2` or `"a"`. A document which does not have *both* attributes `x` and `y`
/// In the example below we create a bitarray index with two fields. Field *x*
/// can have the values of either *0* or *1*; while field *y* can have the values
/// of *2* or *"a"*. A document which does not have *both* attributes *x* and *y*
/// will not take part within the index. A document which does have both attributes
/// `x` and `y` defined must have the values `0` or `1` for attribute `x` and
/// `2` or `a` for attribute `y`, otherwise the document will not be inserted
/// *x* and *y* defined must have the values *0* or *1* for attribute *x* and
/// *2* or *1* for attribute *y*, otherwise the document will not be inserted
/// within the collection.
///
/// @code
@ -961,12 +961,12 @@ ArangoCollection.prototype.updateByExample = function (example,
/// }
/// @endcode
///
/// In the example below we create a bitarray index with two fields. Field `x`
/// can have the values of either `0` or `1`; while field `y` can have the
/// values of `2`, `"a"` or *other* . A document which does not have *both*
/// attributes `x` and `y` will not take part within the index. A document
/// which does have both attributes `x` and `y` defined must have the values `0`
/// or `1` for attribute `x` and any value for attribute `y` will be acceptable,
/// In the example below we create a bitarray index with two fields. Field *x*
/// can have the values of either *0* or *1*; while field *y* can have the
/// values of *2*, *"a"* or *other* . A document which does not have *both*
/// attributes *x* and *y* will not take part within the index. A document
/// which does have both attributes *x* and *y* defined must have the values *0*
/// or *1* for attribute *x* and any value for attribute *y* will be acceptable,
/// otherwise the document will not be inserted within the collection.
///
/// @code
@ -980,6 +980,7 @@ ArangoCollection.prototype.updateByExample = function (example,
/// "isNewlyCreated" : true
/// }
/// @endcode
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureBitarray = function () {
@ -1000,8 +1001,8 @@ ArangoCollection.prototype.ensureBitarray = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a bitarray index exists
///
/// @FUN{@FA{collection}.ensureUndefBitarray(@FA{field1}, @FA{value1}, ..., @FA{fieldn}, @FA{valuen})}
/// @startDocuBlock collectionEnsureUndefBitArray
/// `collection.ensureUndefBitarray(field*1*, value*1*, ..., field*n*, value*n*)`
///
/// Creates a bitarray index on all documents using attributes as paths to
/// the fields. At least one attribute and one set of possible values must be given.
@ -1012,6 +1013,7 @@ ArangoCollection.prototype.ensureBitarray = function () {
/// is returned.
///
/// @verbinclude fluent14
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureUndefBitarray = function () {
@ -1033,17 +1035,17 @@ ArangoCollection.prototype.ensureUndefBitarray = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a cap constraint exists
/// @startDocuBlock collectionEnsureCapConstraint
/// `collection.ensureCapConstraint(size, byteSize)`
///
/// @FUN{@FA{collection}.ensureCapConstraint(@FA{size}, {byteSize})}
///
/// Creates a size restriction aka cap for the collection of @FA{size}
/// documents and/or @FA{byteSize} data size. If the restriction is in place
/// and the (@FA{size} plus one) document is added to the collection, or the
/// total active data size in the collection exceeds @FA{byteSize}, then the
/// Creates a size restriction aka cap for the collection of *size*
/// documents and/or *byteSize* data size. If the restriction is in place
/// and the (*size* plus one) document is added to the collection, or the
/// total active data size in the collection exceeds *byteSize*, then the
/// least recently created or updated documents are removed until all
/// constraints are satisfied.
///
/// It is allowed to specify either @FA{size} or @FA{byteSize}, or both at
/// It is allowed to specify either *size* or *byteSize*, or both at
/// the same time. If both are specified, then the automatic document removal
/// will be triggered by the first non-met constraint.
///
@ -1055,11 +1057,12 @@ ArangoCollection.prototype.ensureUndefBitarray = function () {
/// Note that this does not imply any restriction of the number of revisions
/// of documents.
///
/// *Examples*
/// @EXAMPLES
///
/// Restrict the number of document to at most 10 documents:
///
/// @verbinclude ensure-cap-constraint
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureCapConstraint = function (size, byteSize) {
@ -1074,8 +1077,8 @@ ArangoCollection.prototype.ensureCapConstraint = function (size, byteSize) {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a skiplist index exists
///
/// @FUN{ensureUniqueSkiplist(@FA{field1}, @FA{field2}, ...,@FA{fieldn})}
/// @startDocuBlock ensureUniqueSkiplist
/// `ensureUniqueSkiplist(field*1*, field*2*, ...,field*n*)`
///
/// Creates a skiplist index on all documents using attributes as paths to
/// the fields. At least one attribute must be given.
@ -1086,6 +1089,7 @@ ArangoCollection.prototype.ensureCapConstraint = function (size, byteSize) {
/// is returned.
///
/// @verbinclude unique-skiplist
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureUniqueSkiplist = function () {
@ -1100,8 +1104,8 @@ ArangoCollection.prototype.ensureUniqueSkiplist = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a multi skiplist index exists
///
/// @FUN{ensureSkiplist(@FA{field1}, @FA{field2}, ...,@FA{fieldn})}
/// @startDocuBlock ensureSkiplist
/// `ensureSkiplist(field*1*, field*2*, ...,field*n*)`
///
/// Creates a multi skiplist index on all documents using attributes as paths to
/// the fields. At least one attribute must be given.
@ -1112,6 +1116,7 @@ ArangoCollection.prototype.ensureUniqueSkiplist = function () {
/// is returned.
///
/// @verbinclude multi-skiplist
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureSkiplist = function () {
@ -1125,16 +1130,16 @@ ArangoCollection.prototype.ensureSkiplist = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a fulltext index exists
/// @startDocuBlock ensureFulltextIndex
/// `ensureFulltextIndex(field, minWordLength)`
///
/// @FUN{ensureFulltextIndex(@FA{field}, @FA{minWordLength})}
///
/// Creates a fulltext index on all documents on attribute @FA{field}.
/// All documents, which do not have the attribute @FA{field} or that have a
/// non-textual value inside their @FA{field} attribute are ignored.
/// Creates a fulltext index on all documents on attribute *field*.
/// All documents, which do not have the attribute *field* or that have a
/// non-textual value inside their *field* attribute are ignored.
///
/// The minimum length of words that are indexed can be specified with the
/// @FA{minWordLength} parameter. Words shorter than @FA{minWordLength}
/// characters will not be indexed. @FA{minWordLength} has a default value of 2,
/// @FA{minWordLength} parameter. Words shorter than *minWordLength*
/// characters will not be indexed. *minWordLength* has a default value of 2,
/// but this value might be changed in future versions of ArangoDB. It is thus
/// recommended to explicitly specify this value
///
@ -1142,6 +1147,7 @@ ArangoCollection.prototype.ensureSkiplist = function () {
/// is returned.
///
/// @verbinclude fulltext
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureFulltextIndex = function (field, minLength) {
@ -1160,10 +1166,10 @@ ArangoCollection.prototype.ensureFulltextIndex = function (field, minLength) {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a unique constraint exists
/// @startDocuBlock ensureUniqueConstraint
/// `ensureUniqueConstraint(field*1*, field*2*, ...,field*n*)`
///
/// @FUN{ensureUniqueConstraint(@FA{field1}, @FA{field2}, ...,@FA{fieldn})}
///
/// Creates a unique hash index on all documents using @FA{field1}, @FA{field2},
/// Creates a unique hash index on all documents using *field1*, *field2*,
/// ... as attribute paths. At least one attribute path must be given.
///
/// When a unique constraint is in effect for a collection, then all documents
@ -1173,7 +1179,7 @@ ArangoCollection.prototype.ensureFulltextIndex = function (field, minLength) {
/// document is ignored by the index.
///
/// Note that non-existing attribute paths in a document are treated as if the
/// value were @LIT{null}.
/// value were *null*.
///
/// In case that the index was successfully created, the index identifier is
/// returned.
@ -1181,6 +1187,7 @@ ArangoCollection.prototype.ensureFulltextIndex = function (field, minLength) {
/// *Examples*
///
/// @verbinclude shell-index-create-unique-constraint
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureUniqueConstraint = function () {
@ -1195,14 +1202,14 @@ ArangoCollection.prototype.ensureUniqueConstraint = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a hash index exists
/// @startDocuBlock ensureHashIndex
/// `ensureHashIndex(field*1*, field*2*, ...,field*n*)`
///
/// @FUN{ensureHashIndex(@FA{field1}, @FA{field2}, ...,@FA{fieldn})}
///
/// Creates a non-unique hash index on all documents using @FA{field1}, @FA{field2},
/// Creates a non-unique hash index on all documents using *field1*, *field2*,
/// ... as attribute paths. At least one attribute path must be given.
///
/// Note that non-existing attribute paths in a document are treated as if the
/// value were @LIT{null}.
/// value were *null*.
///
/// In case that the index was successfully created, the index identifier
/// is returned.
@ -1210,6 +1217,7 @@ ArangoCollection.prototype.ensureUniqueConstraint = function () {
/// *Examples*
///
/// @verbinclude shell-index-create-hash-index
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureHashIndex = function () {
@ -1223,10 +1231,10 @@ ArangoCollection.prototype.ensureHashIndex = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a geo index exists
/// @startDocuBlock collectionEnsureGeoIndex
/// `collection.ensureGeoIndex(location)`
///
/// @FUN{@FA{collection}.ensureGeoIndex(@FA{location})}
///
/// Creates a geo-spatial index on all documents using @FA{location} as path to
/// Creates a geo-spatial index on all documents using *location* as path to
/// the coordinates. The value of the attribute must be a list with at least two
/// double values. The list must contain the latitude (first value) and the
/// longitude (second value). All documents, which do not have the attribute
@ -1235,25 +1243,24 @@ ArangoCollection.prototype.ensureHashIndex = function () {
/// In case that the index was successfully created, the index identifier is
/// returned.
///
/// @FUN{@FA{collection}.ensureGeoIndex(@FA{location}, @LIT{true})}
/// `collection.ensureGeoIndex(location, true)`
///
/// As above which the exception, that the order within the list is longitude
/// followed by latitude. This corresponds to the format described in
/// [positions](http://geojson.org/geojson-spec.html)
///
/// http://geojson.org/geojson-spec.html#positions
/// `collection.ensureGeoIndex(latitude, longitude)`
///
/// @FUN{@FA{collection}.ensureGeoIndex(@FA{latitude}, @FA{longitude})}
///
/// Creates a geo-spatial index on all documents using @FA{latitude} and
/// @FA{longitude} as paths the latitude and the longitude. The value of the
/// attribute @FA{latitude} and of the attribute @FA{longitude} must a
/// Creates a geo-spatial index on all documents using *latitude* and
/// *longitude* as paths the latitude and the longitude. The value of the
/// attribute *latitude* and of the attribute *longitude* must a
/// double. All documents, which do not have the attribute paths or which values
/// are not suitable, are ignored.
///
/// In case that the index was successfully created, the index identifier
/// is returned.
///
/// *Examples*
/// @EXAMPLES
///
/// Create an geo index for a list attribute:
///
@ -1262,6 +1269,7 @@ ArangoCollection.prototype.ensureHashIndex = function () {
/// Create an geo index for a hash array attribute:
///
/// @verbinclude ensure-geo-index-array
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureGeoIndex = function (lat, lon) {
@ -1295,17 +1303,18 @@ ArangoCollection.prototype.ensureGeoIndex = function (lat, lon) {
////////////////////////////////////////////////////////////////////////////////
/// @brief ensures that a geo constraint exists
/// @startDocuBlock collectionEnsureGeoConstraint
/// `collection.ensureGeoConstraint(location, ignore-null)`
///
/// @FUN{@FA{collection}.ensureGeoConstraint(@FA{location}, @FA{ignore-null})}
/// `collection.ensureGeoConstraint(location, true, ignore-null)`
///
/// @FUN{@FA{collection}.ensureGeoConstraint(@FA{location}, @LIT{true}, @FA{ignore-null})}
/// `collection.ensureGeoConstraint(latitude, longitude, ignore-null)`
///
/// @FUN{@FA{collection}.ensureGeoConstraint(@FA{latitude}, @FA{longitude}, @FA{ignore-null})}
///
/// Works like @FN{ensureGeoIndex} but requires that the documents contain
/// a valid geo definition. If @FA{ignore-null} is true, then documents with
/// a null in @FA{location} or at least one null in @FA{latitude} or
/// @FA{longitude} are ignored.
/// Works like *ensureGeoIndex* but requires that the documents contain
/// a valid geo definition. If *ignore-null* is true, then documents with
/// a null in *location* or at least one null in *latitude* or
/// *longitude* are ignored.
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.ensureGeoConstraint = function (lat, lon, ignoreNull) {
@ -1404,10 +1413,11 @@ ArangoCollection.prototype.lookupSkiplist = function () {
////////////////////////////////////////////////////////////////////////////////
/// @brief looks up a fulltext index
/// @startDocuBlock lookUpFulltextIndex
/// `lookupFulltextIndex(field, minLength)`
///
/// @FUN{lookupFulltextIndex(@FA{field}, @FA{minLength}}
///
/// Checks whether a fulltext index on the given attribute @FA{field} exists.
/// Checks whether a fulltext index on the given attribute *field* exists.
/// @endDocuBlock
////////////////////////////////////////////////////////////////////////////////
ArangoCollection.prototype.lookupFulltextIndex = function (field, minLength) {