mongo

Functions

pub fn collection(db: Database, name: String) -> Collection
pub fn connect(uri: String) -> Result(Database, Nil)
pub fn count(collection: Collection, filter: Value) -> Result(
  Int,
  MongoError,
)
pub fn count_all(collection: Collection) -> Result(
  Int,
  MongoError,
)
pub fn delete_many(collection: Collection, filter: Value) -> Result(
  Int,
  MongoError,
)
pub fn delete_one(collection: Collection, filter: Value) -> Result(
  Int,
  MongoError,
)
pub fn find_all(collection: Collection, options: List(FindOption)) -> Result(
  List(Value),
  MongoError,
)
pub fn find_by_id(collection: Collection, id: String) -> Result(
  Value,
  MongoError,
)
pub fn find_many(collection: Collection, filter: Value, options: List(
    FindOption,
  )) -> Result(List(Value), MongoError)
pub fn find_one(collection: Collection, filter: Value, projection: Value) -> Result(
  Value,
  MongoError,
)
pub fn insert_many(collection: Collection, docs: List(Value)) -> Result(
  InsertResult,
  MongoError,
)
pub fn insert_one(collection: Collection, doc: Value) -> Result(
  Value,
  MongoError,
)
pub fn update_many(collection: Collection, filter: Value, change: Value, options: List(
    UpdateOption,
  )) -> Result(UpdateResult, MongoError)
pub fn update_one(collection: Collection, filter: Value, change: Value, options: List(
    UpdateOption,
  )) -> Result(UpdateResult, MongoError)
Search Document