struct
Mongo
pub struct Mongo {
/* private fields */
}The browser side: builds commands for your API route.
Methods
new
pub fn new(endpoint: &str) -> MongoA client for the app's own MongoDB route at endpoint, which checks each request against its policy.
find
pub fn find(&self, collection: &str, filter: Json) -> BuilderFind the documents in collection matching filter.
find_one
pub fn find_one(&self, collection: &str, filter: Json) -> BuilderFind one document in collection matching filter.
count
pub fn count(&self, collection: &str, filter: Json) -> BuilderCount the documents in collection matching filter.
aggregate
pub fn aggregate(&self, collection: &str, pipeline: Json) -> BuilderRun aggregation pipeline on collection.
insert_one
pub fn insert_one(&self, collection: &str, document: Json) -> BuilderInsert document into collection.
update_one
pub fn update_one(&self, collection: &str, filter: Json, update: Json) -> BuilderApply update to the first document in collection matching filter.
delete_one
pub fn delete_one(&self, collection: &str, filter: Json) -> BuilderDelete the first document in collection matching filter.