[][src]Struct arangors::collection::Collection

pub struct Collection<'a> { /* fields omitted */ }

Methods

impl<'a> Collection<'a>[src]

pub fn get_collection_type(&self) -> &CollectionType[src]

pub fn get_id(&self) -> &str[src]

pub fn get_name(&self) -> &str[src]

pub fn get_url(&self) -> &Url[src]

pub fn get_session(&self) -> Arc<Client>[src]

pub fn truncate(&self)[src]

pub fn fetch_properties(&self)[src]

Fetch the properties of collection

pub fn fetch_document_count(&self)[src]

Counts the documents in this collection

pub fn fetch_statistics(&self)[src]

Fetch the statistics of a collection

the result also contains the number of documents and additional statistical information about the collection. Note: This will always load the collection into memory.

Note: collection data that are stored in the write-ahead log only are not reported in the results. When the write-ahead log is collected, documents might be added to journals and datafiles of the collection, which may modify the figures of the collection.

Additionally, the filesizes of collection and index parameter JSON files are not reported. These files should normally have a size of a few bytes each. Please also note that the fileSize values are reported in bytes and reflect the logical file sizes. Some filesystems may use optimisations (e.g. sparse files) so that the actual physical file size is somewhat different. Directories and sub-directories may also require space in the file system, but this space is not reported in the fileSize results.

That means that the figures reported do not reflect the actual disk usage of the collection with 100% accuracy. The actual disk usage of a collection is normally slightly higher than the sum of the reported fileSize values. Still the sum of the fileSize values can still be used as a lower bound approximation of the disk usage.

pub fn fetch_revision_id(&self)[src]

Retrieve the collections revision id

The revision id is a server-generated string that clients can use to check whether data in a collection has changed since the last revision check.

pub fn fetch_checksum(&self)[src]

Fetch a checksum for the specified collection

Will calculate a checksum of the meta-data (keys and optionally revision ids) and optionally the document data in the collection.

pub fn load(&self)[src]

Loads a collection into memory.

pub fn unload(&self)[src]

Removes a collection from memory. This call does not delete any documents. You can use the collection afterwards; in which case it will be loaded into memory, again.

pub fn load_indexes(&self)[src]

Load Indexes into Memory

This route tries to cache all index entries of this collection into the main memory. Therefore it iterates over all indexes of the collection and stores the indexed values, not the entire document data, in memory. All lookups that could be found in the cache are much faster than lookups not stored in the cache so you get a nice performance boost. It is also guaranteed that the cache is consistent with the stored data.

For the time being this function is only useful on RocksDB storage engine, as in MMFiles engine all indexes are in memory anyways.

On RocksDB this function honors all memory limits, if the indexes you want to load are smaller than your memory limit this function guarantees that most index values are cached. If the index is larger than your memory limit this function will fill up values up to this limit and for the time being there is no way to control which indexes of the collection should have priority over others.

On sucess this function returns an object with attribute result set to true

pub fn change_properties(&self)[src]

Changes the properties of a collection.

pub fn rename_collection(&self)[src]

Renames the collection

pub fn rotate_journal(&self)[src]

Rotates the journal of a collection.

The current journal of the collection will be closed and made a read-only datafile. The purpose of the rotate method is to make the data in the file available for compaction (compaction is only performed for read-only datafiles, and not for journals).

Saving new data in the collection subsequently will create a new journal file automatically if there is no current journal.

pub fn create_document<T>(&self, _doc: Document<T>)[src]

Creates a new document from the document given in the body, unless there is already a document with the _key given. If no _key is given, a new unique _key is generated automatically.

pub fn update_document<T>(&self, _doc: Document<T>)[src]

Partially updates the document

pub fn replace_document<T>(&self, _doc: Document<T>)[src]

Replaces the document

pub fn remove_document<T>(&self, _doc: Document<T>)[src]

Removes a document

Trait Implementations

impl<'a> Debug for Collection<'a>[src]

Auto Trait Implementations

impl<'a> Sync for Collection<'a>

impl<'a> Send for Collection<'a>

impl<'a> Unpin for Collection<'a>

impl<'a> !RefUnwindSafe for Collection<'a>

impl<'a> !UnwindSafe for Collection<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err