Module MongoAdmin

module MongoAdmin: sig .. end
This is a major client-faced module, for the high level usage.

This module includes a series of APIs that client can use directly to obtain some admin level of information about a MongoDB, e.g., the list of databases inside, etc. Currently all commands are read-only ones, which means they are just retrieving infomation from MongoDB, not setting any configurations.

Please refer to MongoDB Commands for more information

exception MongoAdmin_failed of string
the exception will be raised if anything is wrong, with a string message
type t 
the type for MongoAdmin

Essential info of a MongoAdmin

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

Lifecycle of a MongoAdmin

val create : string -> int -> t
create a MongoAdmin. e.g. create ip port. May raise MongoAdmin_failed exception.
val create_local_default : unit -> t
create a MongoAdmin connecting to, port 27017. May raise MongoAdmin_failed exception.
val destory : t -> unit
destory a MongoAdmin. Please use this to destory a MongoAdmin once it finishes its purpose, in order to release system resources. May raise MongoAdmin_failed exception.

Commands via a MongoAdmin, may raise MongoAdmin_failed exception.

val listDatabases : t -> MongoReply.t
val buildInfo : t -> MongoReply.t
val collStats : t -> MongoReply.t
val connPoolStats : t -> MongoReply.t
val cursorInfo : t -> MongoReply.t
val getCmdLineOpts : t -> MongoReply.t
val hostInfo : t -> MongoReply.t
val listCommands : t -> MongoReply.t
val serverStatus : t -> MongoReply.t