mongo

Functions

pub fn collection(db: Database, name: String) -> Collection
pub fn connect(ip: String, port: Int) -> Result(Connection, Nil)
pub fn count(collection: Collection, filter: Value) -> Result(
  Int,
  MongoError,
)
pub fn count_all(collection: Collection) -> Result(
  Int,
  MongoError,
)
pub fn db(connection: Connection, name: String) -> Database
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(collection: Collection, filter: Value, options: List(
    FindOption,
  )) -> Result(List(Value), MongoError)
pub fn find_all(collection: Collection, options: List(FindOption)) -> Result(
  List(Value),
  MongoError,
)
pub fn insert_many(collection: Collection, docs: List(Value)) -> Result(
  Int,
  MongoError,
)
pub fn insert_one(collection: Collection, doc: Value) -> Result(
  Int,
  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)