[][src]Struct mongodb_h2co3::coll::Collection

pub struct Collection {
    pub db: Database,
    pub namespace: String,
    // some fields omitted
}

Interfaces with a MongoDB collection.

Fields

A reference to the database that spawned this collection.

The namespace of this collection, formatted as db_name.coll_name.

Methods

impl Collection
[src]

Creates a collection representation with optional read and write controls.

If create is specified, the collection will be explicitly created in the database.

Returns a unique operational request id.

Extracts the collection name from the namespace. If the namespace is invalid, this method will panic.

Permanently deletes the collection from the database.

Runs an aggregation framework pipeline.

Gets the number of documents matching the filter.

Finds the distinct values for a specified field across a single collection.

Returns a list of documents within the collection that match the filter.

Returns the first document within the collection that matches the filter, or None.

Finds a single document and deletes it, returning the original.

Finds a single document and replaces it, returning either the original or replaced document.

Finds a single document and updates it, returning either the original or updated document.

Sends a batch of writes to the server at the same time.

Inserts the provided document. If the document is missing an identifier, the driver should generate one.

Inserts the provided documents. If any documents are missing an identifier, the driver should generate them.

Deletes a single document.

Deletes multiple documents.

Replaces a single document.

Updates a single document.

Updates multiple documents.

Create a single index.

Create a single index with an IndexModel.

Create multiple indexes.

Drop an index.

Drop an index by name.

Drop an index by IndexModel.

Drop all indexes in the collection.

List all indexes in the collection.

Trait Implementations

impl Debug for Collection
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Collection

impl Sync for Collection

Blanket Implementations

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

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

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.

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

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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.

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

Performs the conversion.

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

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

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

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

impl<T> Same for T

Should always be Self