Struct mon::coll::Collection [] [src]

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]

[src]

Creates a collection representation with optional read and write controls.

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

[src]

Returns a unique operational request id.

[src]

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

[src]

Permanently deletes the collection from the database.

[src]

Runs an aggregation framework pipeline.

[src]

Gets the number of documents matching the filter.

[src]

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

[src]

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

[src]

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

[src]

[src]

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

[src]

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

[src]

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

[src]

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

[src]

[src]

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

[src]

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

[src]

Deletes a single document.

[src]

Deletes multiple documents.

[src]

Replaces a single document.

[src]

Updates a single document.

[src]

Updates multiple documents.

[src]

Create a single index.

[src]

Create a single index with an IndexModel.

[src]

Create multiple indexes.

[src]

Drop an index.

[src]

Drop an index by name.

[src]

Drop an index by IndexModel.

[src]

Drop all indexes in the collection.

[src]

List all indexes in the collection.