[][src]Struct avocado::coll::Collection

pub struct Collection<T: Doc> { /* fields omitted */ }

A statically-typed (homogeneous) MongoDB collection.

Methods

impl<T: Doc> Collection<T>
[src]

Creates indexes on the underlying MongoDB collection according to the given index specifications.

Deletes the collection.

Returns the number of documents matching the query criteria.

Returns the distinct values of a certain field.

Runs an aggregation pipeline.

Retrieves a single document satisfying the query, if one exists.

Retrieves all documents satisfying the query.

Inserts a single document.

Inserts many documents.

Convenience method for updating a single document based on identity (its _id field), setting all fields to the values supplied by entity.

This doesn't add a new document if none with the specified _id exists.

Convenience method for updating a single document based on identity (its _id field), setting all fields to the values supplied by entity.

This method adds a new document if none with the specified _id exists.

Updates a single document.

This method only works with update operators (with field names starting with $), i.e. it does not replace entire documents.

Upserts a single document.

This method only works with update operators (with field names starting with $), i.e. it does not replace entire documents.

Updates multiple documents.

This method only works with update operators (with field names starting with $), i.e. it does not replace entire documents.

Upserts multiple documents (updates many or inserts one if none found).

This method only works with update operators (with field names starting with $), i.e. it does not replace entire documents.

Convenience method for deleting a single entity based on its identity (the _id field). Returns true if it was found and deleted.

Convenience method for deleting entities based on their identity (the _id fields). Returns the number of deleted documents.

Deletes one document. Returns true if one was found and deleted.

Deletes many documents. Returns the number of deleted documents.

Trait Implementations

impl<T: Doc> Debug for Collection<T>
[src]

Auto Trait Implementations

impl<T> Send for Collection<T> where
    T: Send

impl<T> Sync for Collection<T> where
    T: Sync

Blanket Implementations

impl<T> From for T
[src]

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

impl<T> Same for T

Should always be Self