   # @property {object} MongoDB instance
   @dbInstance: undefined
 
+  # @property {object} MongoDB client handle
+  @mongoclient: undefined
+
   #
   # Adapter's constructor
   # @param properties {object} Launch properties of the adapter

    @start() unless @started

    if @dbInstance isnt undefined
      doc = _.omit buffer, 'msgid'
      doc._id = buffer.msgid

      @dbInstance.collection(@properties.collection).save doc, {safe:true}, (err, res) =>
        if err
          @owner.log "error", "Error while save hMessage in database"
    else
      @owner.log "warn", "MongoDB not yet started"


  # @private
  #
  h_connectToDatabase: () ->
    mongo_host = @properties.host || "127.0.0.1"
    mongo_port = @properties.port || mongo.Connection.DEFAULT_PORT
    mongo_server_options = {auto_reconnect: true}
    mongo_dbname = @properties.name
    mongoserver = new mongo.Server(mongo_host, mongo_port, mongo_server_options)
    @mongoclient = new mongo.MongoClient(mongoserver);

    @mongoclient.open (err, mongoclient) =>
      @owner.log "debug", "Opened mongodb link"
      if err
        @owner.log "error", "Couldn't connect to mongodb. If connection infos are valid, pool should connect as soon as the server is available. Error : " + err
      @dbInstance = mongoclient.db mongo_dbname

      if @properties.user and @properties.password
        @dbInstance.authenticate @properties.user, @properties.password, (err, success) =>
          if err
            @owner.log "Error authenticating to mongodb. If authentication infos are valid, it should authenticate when server is available : " + err

  #
  # @overload start()
