Document¶
-
class
pyArango.document.
DocumentStore
(collection, validators=None, initDct=None, patch=False, subStore=False, validateInit=False)[source]¶ Store all the data of a document in hierarchy of stores and handles validation. Does not store private information, these are in the document.
-
class
pyArango.document.
Document
(collection, jsonFieldInit=None, on_load_validation=False)[source]¶ The class that represents a document. Documents are meant to be instanciated by collections
-
getEdges
(edges, inEdges=True, outEdges=True, rawResults=False)[source]¶ returns in, out, or both edges linked to self belonging the collection ‘edges’. If rawResults a arango results will be return as fetched, if false, will return a liste of Edge objects
-
getOutEdges
(edges, rawResults=False)[source]¶ An alias for getEdges() that returns only the out Edges
-
getResponsibleShard
()[source]¶ If we’re working with an arangodb cluster, we can use this method to fetch where a document lives.
-
patch
(keepNull=True, **docArgs)[source]¶ Saves the document by only updating the modified fields. The default behaviour concening the keepNull parameter is the opposite of ArangoDB’s default, Null values won’t be ignored Use docArgs for things such as waitForSync = True
-
reset
(collection, jsonFieldInit=None, on_load_validation=False)[source]¶ replaces the current values in the document by those in jsonFieldInit
-
save
(waitForSync=False, **docArgs)[source]¶ Saves the document to the database by either performing a POST (for a new document) or a PUT (complete document overwrite). If you want to only update the modified fields use the .patch() function. Use docArgs to put things such as ‘waitForSync = True’ (for a full list cf ArangoDB’s doc). It will only trigger a saving of the document if it has been modified since the last save. If you want to force the saving you can use forceSave()
-
-
class
pyArango.document.
Edge
(edgeCollection, jsonFieldInit=None, on_load_validation=False)[source]¶ An Edge document
-
links
(fromVertice, toVertice, **edgeArgs)[source]¶ An alias to save that updates the _from and _to attributes. fromVertice and toVertice, can be either strings or documents. It they are unsaved documents, they will be automatically saved.
-