ArangoDocuments

avokka.arangodb.ArangoDocuments
See theArangoDocuments companion object
trait ArangoDocuments[F[_]]

Arango documents API

Type parameters

F

effect

Attributes

See also
Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def count(transactionId: Option[TransactionId]): F[ArangoResponse[CollectionCount]]

Counts the documents in a collection

Counts the documents in a collection

Attributes

def create[T : VPackEncoder](documents: Seq[T], waitForSync: Boolean, returnNew: Boolean, returnOld: Boolean, silent: Boolean, overwrite: Boolean, transaction: Option[TransactionId]): F[ArangoResponse[Seq[Document[T]]]]

Create documents

Create documents

Type parameters

T

document type

Value parameters

documents

documents value

overwrite

If set to true, the insert becomes a replace-insert. If a document with the same _key already exists the new document is not rejected with unique constraint violated but will replace the old document. (optional)

returnNew

Additionally return the complete new document under the attribute new in the result. (optional)

returnOld

Additionally return the complete old document under the attribute old in the result. Only available if the overwrite option is used. (optional)

silent

If set to true, an empty object will be returned as response. No meta-data will be returned for the created document. This option can be used to save some network traffic. (optional)

waitForSync

Wait until document has been synced to disk. (optional)

Attributes

def insert[T : VPackDecoder](document: T, waitForSync: Boolean, returnNew: Boolean, returnOld: Boolean, silent: Boolean, overwrite: Boolean, transaction: Option[TransactionId]): F[ArangoResponse[Document[T]]]

Create a document

Create a document

Type parameters

T

document type

Value parameters

document

document value

overwrite

If set to true, the insert becomes a replace-insert. If a document with the same _key already exists the new document is not rejected with unique constraint violated but will replace the old document. (optional)

returnNew

Additionally return the complete new document under the attribute new in the result. (optional)

returnOld

Additionally return the complete old document under the attribute old in the result. Only available if the overwrite option is used. (optional)

silent

If set to true, an empty object will be returned as response. No meta-data will be returned for the created document. This option can be used to save some network traffic. (optional)

waitForSync

Wait until document has been synced to disk. (optional)

Attributes

def remove[T : VPackDecoder, K : VPackEncoder](keys: Seq[K], waitForSync: Boolean, returnOld: Boolean, ignoreRevs: Boolean, transaction: Option[TransactionId]): F[ArangoResponse[Seq[Document[T]]]]

The body of the request is an array consisting of selectors for documents. A selector can either be a string with a key or a string with a document handle or an object with a _key attribute. This API call removes all specified documents from collection. If the selector is an object and has a _rev attribute, it is a precondition that the actual revision of the removed document in the collection is the specified one

The body of the request is an array consisting of selectors for documents. A selector can either be a string with a key or a string with a document handle or an object with a _key attribute. This API call removes all specified documents from collection. If the selector is an object and has a _rev attribute, it is a precondition that the actual revision of the removed document in the collection is the specified one

Type parameters

K

Key selector type

T

Response body type

Value parameters

ignoreRevs

If set to true, ignore any _rev attribute in the selectors. No revision check is performed

keys

Removes the document identified by document-handle.

returnOld

Return additionally the complete previous revision of the changed document under the attribute old in the result.

waitForSync

Wait until deletion operation has been synced to disk.

Attributes

def replace[T : VPackEncoder](documents: Seq[T], waitForSync: Boolean, ignoreRevs: Boolean, returnOld: Boolean, returnNew: Boolean, transaction: Option[TransactionId]): F[ArangoResponse[Seq[Document[T]]]]

Replaces multiple documents in the specified collection with the ones in the body, the replaced documents are specified by the _key attributes in the body documents.

Replaces multiple documents in the specified collection with the ones in the body, the replaced documents are specified by the _key attributes in the body documents.

Type parameters

T

document type

Value parameters

documents

representation of an array of documents

ignoreRevs

By default, or if this is set to true, the _rev attributes in the given documents are ignored. If this is set to false, then any _rev attribute given in a body document is taken as a precondition. The document is only replaced if the current revision is the one specified

returnNew

Return additionally the complete new documents under the attribute new in the result

returnOld

Return additionally the complete previous revision of the changed documents under the attribute old in the result

waitForSync

Wait until the new documents have been synced to disk

Attributes

def update[T : VPackDecoder, P : VPackEncoder](patch: Seq[P], keepNull: Boolean, mergeObjects: Boolean, waitForSync: Boolean, ignoreRevs: Boolean, returnOld: Boolean, returnNew: Boolean, transaction: Option[TransactionId]): F[ArangoResponse[Seq[Document[T]]]]

Partially updates documents, the documents to update are specified by the _key attributes in the body objects. The body of the request must contain a JSON array of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there

Partially updates documents, the documents to update are specified by the _key attributes in the body objects. The body of the request must contain a JSON array of document updates with the attributes to patch (the patch documents). All attributes from the patch documents will be added to the existing documents if they do not yet exist, and overwritten in the existing documents if they do exist there

Type parameters

P

patch type

T

document type

Value parameters

ignoreRevs

By default, or if this is set to true, the _rev attributes in the given documents are ignored. If this is set to false, then any _rev attribute given in a body document is taken as a precondition. The document is only updated if the current revision is the one specified

keepNull

If the intention is to delete existing attributes with the patch command, the URL query parameter keepNull can be used with a value of false. This will modify the behavior of the patch command to remove any attributes from the existing document that are contained in the patch document with an attribute value of null

mergeObjects

Controls whether objects (not arrays) will be merged if present in both the existing and the patch document. If set to false, the value in the patch document will overwrite the existing document's value. If set to true, objects will be merged. The default is true

patch

representation of an array of document updates as objects

returnNew

Return additionally the complete new documents under the attribute new in the result

returnOld

Return additionally the complete previous revision of the changed documents under the attribute old in the result

waitForSync

Wait until the new documents have been synced to disk

Attributes