lib/index.js
function(dbName, collection, metric, callback) {
	var colInfo = {capped:true, size:options.size*options.max, max:options.max};

	database(dbName, function(err, db) {
		if (err) {
			db.close();
			return callback(err);
		};

		db.createCollection(collection, colInfo, function(err, collClient) {      
			collClient.insert(metric, function(err, data){
				if (err) callback(err);
				if (!err) callback(false, collection);
			});
		});
	});
}
function(dbName, collection, metric, callback) {
	var colInfo = {capped:true, size:options.size*options.max, max:options.max};

	database(dbName, function(err, db) {
		if (err) {
			db.close();
			return callback(err);
		};

		db.createCollection(collection, colInfo, function(err, collClient) {      
			collClient.insert(metric, function(err, data){
				if (err) callback(err);
				if (!err) callback(false, collection);
			});
		});
	});
}
function ( dbName , collection , metric , callback ) { var colInfo = { capped : true , size : options . size * options . max , max : options . max } ; database ( dbName , function ( err , db ) { if ( err ) { db . close ( ) ; return callback ( err ) ; } ; db . createCollection ( collection , colInfo , function ( err , collClient ) { collClient . insert ( metric , function ( err , data ) { if ( err ) callback ( err ) ; if ( ! err ) callback ( false , collection ) ; } ) ; } ) ; } ) ; }
Insert the data to the database
@method insert
@param {String} database
@param {String} collection
@param {Object} metric
@param {Function} callback
Insert the data to the database