package mongo

  1. Overview
  2. Docs
exception Mongo_failed of string
type t
val get_db_name : t -> string
val get_collection_name : t -> string
val get_ip : t -> string
val get_port : t -> int
val get_file_descr : t -> Unix.file_descr
val create : string -> int -> string -> string -> t
val create_local_default : string -> string -> t
val destory : t -> unit
val insert : t -> Bson.t list -> unit
val update_one : ?upsert:bool -> t -> (Bson.t * Bson.t) -> unit
val update_all : ?upsert:bool -> t -> (Bson.t * Bson.t) -> unit
val delete_one : t -> Bson.t -> unit
val delete_all : t -> Bson.t -> unit
val find : ?skip:int -> t -> MongoReply.t
val find_one : ?skip:int -> t -> MongoReply.t
val find_of_num : ?skip:int -> t -> int -> MongoReply.t
val find_q : ?skip:int -> t -> Bson.t -> MongoReply.t
val find_q_one : ?skip:int -> t -> Bson.t -> MongoReply.t
val find_q_of_num : ?skip:int -> t -> Bson.t -> int -> MongoReply.t
val find_q_s : ?skip:int -> t -> Bson.t -> Bson.t -> MongoReply.t
val find_q_s_one : ?skip:int -> t -> Bson.t -> Bson.t -> MongoReply.t
val find_q_s_of_num : ?skip:int -> t -> Bson.t -> Bson.t -> int -> MongoReply.t
val count : ?skip:int -> ?limit:int -> ?query:Bson.t -> t -> int
val get_more_of_num : t -> int64 -> int -> MongoReply.t
val get_more : t -> int64 -> MongoReply.t
val kill_cursors : t -> int64 list -> unit
type index_option =
  1. | Background of bool
  2. | Unique of bool
  3. | Name of string
  4. | DropDups of bool
  5. | Sparse of bool
  6. | ExpireAfterSeconds of int
  7. | V of int
  8. | Weight of Bson.t
  9. | Default_language of string
  10. | Language_override of string
val get_indexes : t -> MongoReply.t
val ensure_index : t -> Bson.t -> index_option list -> unit
val ensure_simple_index : ?options:index_option list -> t -> string -> unit
val ensure_multi_simple_index : ?options:index_option list -> t -> string list -> unit
val drop_index : t -> string -> MongoReply.t
val drop_all_index : t -> MongoReply.t
val change_collection : t -> string -> t
val drop_collection : t -> MongoReply.t
val drop_database : t -> MongoReply.t
OCaml

Innovation. Community. Security.