Struct mungos::Collection
source · pub struct Collection<T> {
pub db: Database,
pub collection: Collection<T>,
}
Fields§
§db: Database
§collection: Collection<T>
Implementations§
source§impl<T> Collection<T>
impl<T> Collection<T>
pub async fn create_index(&self, field: &str) -> Result<CreateIndexResult>
pub async fn create_unique_index(&self, field: &str) -> Result<CreateIndexResult>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
pub async fn aggregate(
&self,
pipeline: impl IntoIterator<Item = impl Into<Document>>,
options: impl Into<Option<AggregateOptions>>
) -> Result<Cursor<Document>>
pub async fn aggregate_collect(
&self,
pipeline: impl IntoIterator<Item = impl Into<Document>>,
options: impl Into<Option<AggregateOptions>>
) -> Result<Vec<Document>>
source§impl<T> Collection<T>
impl<T> Collection<T>
pub async fn bulk_upsert(&self, updates: Vec<BulkUpsert>) -> Result<Document>
source§impl<T: Serialize> Collection<T>
impl<T: Serialize> Collection<T>
pub async fn create_many(
&self,
items: impl IntoIterator<Item = impl Borrow<T>>
) -> Result<()>
source§impl<T: Serialize> Collection<T>
impl<T: Serialize> Collection<T>
pub async fn create_one(&self, item: impl Borrow<T>) -> Result<String>
source§impl<T> Collection<T>
impl<T> Collection<T>
pub async fn delete_many(&self, filter: Document) -> Result<DeleteResult>
source§impl<T> Collection<T>
impl<T> Collection<T>
pub async fn delete_one(&self, id: &str) -> Result<String>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
pub async fn get_many_by_id(
&self,
ids: &Vec<String>,
options: impl Into<Option<FindOptions>>
) -> Result<Vec<T>>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
impl<T: DeserializeOwned + Unpin + Send + Sync> Collection<T>
source§impl<Any> Collection<Any>
impl<Any> Collection<Any>
source§impl<Any> Collection<Any>
impl<Any> Collection<Any>
source§impl<T> Collection<T>
impl<T> Collection<T>
pub async fn upsert(
&self,
query: Document,
update: impl Into<UpdateModifications>
) -> Result<UpdateResult>
Trait Implementations§
source§impl<T: Clone> Clone for Collection<T>
impl<T: Clone> Clone for Collection<T>
source§fn clone(&self) -> Collection<T>
fn clone(&self) -> Collection<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more