ArangoDocument

avokka.arangodb.ArangoDocument
See theArangoDocument companion object
trait ArangoDocument[F[_]]

Arango document API

Type parameters

F

effect

Attributes

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

Members list

Value members

Abstract methods

document handle

document handle

Attributes

def head(ifNoneMatch: Option[String], ifMatch: Option[String], transaction: Option[TransactionId]): F[Header]

Like read, but only returns the header fields and not the body. You can use this call to get the current revision of a document or check if the document was deleted.

Like read, but only returns the header fields and not the body. You can use this call to get the current revision of a document or check if the document was deleted.

Value parameters

ifMatch

If the “If-Match” header is given, then it must contain exactly one Etag. The document is returned, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned.

ifNoneMatch

If the “If-None-Match” header is given, then it must contain exactly one Etag. If the current document revision is not equal to the specified Etag, an HTTP 200 response is returned. If the current document revision is identical to the specified Etag, then an HTTP 304 is returned.

Attributes

def read[T : VPackDecoder](ifNoneMatch: Option[String], ifMatch: Option[String], transaction: Option[TransactionId]): F[ArangoResponse[T]]

Returns the document identified by document-handle. The returned document contains three special attributes: _id containing the document handle, _key containing key which uniquely identifies a document in a given collection and _rev containing the revision.

Returns the document identified by document-handle. The returned document contains three special attributes: _id containing the document handle, _key containing key which uniquely identifies a document in a given collection and _rev containing the revision.

Type parameters

T

The type of the document.

Value parameters

ifMatch

If the "If-Match" header is given, then it must contain exactly one Etag. The document is returned, if it has the same revision as the given Etag. Otherwise a HTTP 412 is returned.

ifNoneMatch

If the "If-None-Match" header is given, then it must contain exactly one Etag. The document is returned, if it has a different revision than the given Etag. Otherwise an HTTP 304 is returned.

Attributes

def remove[T : VPackDecoder](waitForSync: Boolean, returnOld: Boolean, silent: Boolean, ifMatch: Option[String], transaction: Option[TransactionId]): F[ArangoResponse[Document[T]]]

Removes a document

Removes a document

Type parameters

T

Response body type

Value parameters

ifMatch

You can conditionally remove a document based on a target revision id by using the if-match HTTP header.

returnOld

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

silent

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

waitForSync

Wait until deletion operation has been synced to disk.

Attributes

def replace[T : VPackDecoder](document: T, waitForSync: Boolean, ignoreRevs: Boolean, returnOld: Boolean, returnNew: Boolean, silent: Boolean, ifMatch: Option[String], transaction: Option[TransactionId]): F[ArangoResponse[Document[T]]]

Type parameters

T

document type

Value parameters

document

representation of a document update as an object

ifMatch

You can conditionally update a document based on a target revision id by using the if-match HTTP header. (optional)

ignoreRevs

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

returnNew

Return additionally the complete new document under the attribute new in the result. (optional)

returnOld

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

silent

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

waitForSync

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

Attributes

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

Type parameters

P

patch type

T

document type

Value parameters

ifMatch

You can conditionally update a document based on a target revision id by using the if-match HTTP header. (optional)

ignoreRevs

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

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. (optional)

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. (optional)

patch

representation of a document update as an object

returnNew

Return additionally the complete new document under the attribute new in the result. (optional)

returnOld

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

silent

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

waitForSync

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

Attributes

build an UPSERT query at key with INSERT+UPDATE from obj

build an UPSERT query at key with INSERT+UPDATE from obj

Value parameters

obj

vpack object

Attributes

Returns

query