Instantiation (FuelDB fuelDB) FuelDB(object options)

var fueldb = new FuelDB({uri:"localhost:8101",ssl:false,user:"admin",password:"admin"});

Instantiation allow you to create and initialize a handler to manage a connection with the database. You can open multiple connection to the same or other database. The connection is open during the instanciation.

Connecting connect(object options)

fueldb.connect({uri:"localhost:8101",ssl:false,user:"admin",password:"admin"});

Open the connection to the database. If a connection is already open, it just close and reopen it.

Disconnecting disconnect()

fueldb.disconnect();

Close the connection to the database

Subscription (string idSub) subscribe(string point, function callback, function error)

var idSub = fueldb.subscribe("your.data.point", function(obj){
	console.log("Old value: "+obj.old.value+" Date: "+obj.old.date);
	console.log("New value: "+obj.value+" Date: "+obj.date);
	// ...
 });

Subscription allow you to listen to a data point in the database, the callback function will be called as soon as a new entry for the data point parameter will be saved.

Unsubscribing unsubscribe(string point, string idSub)

fueldb.unsubscribe("your.data.point", idSub);

This method cancel a subscription. If idSub is not provided, all the subscriptions for the point will be canceled.

Writing write(string point, object value)

fueldb.write("your.data.point", {"age":23,"name":"John"});

Write a value in a data point. It can be a string, a number or a JSON object.

Reading read(string point, function callback, function error)

fueldb.read("your.data.point", function(obj){
	console.log("Value: "+obj.value+" Date: "+obj.date);
	//...
});

Read a value in a data point. It can be a string, a number or a JSON object.

Removing remove(string point, function error)

fueldb.remove("your.data.point");

Remove a data point.

Browsing browse(string point, function callback, function error)

fueldb.browse("your.data.point", function(points){
	console.log("Points: "+points.join(" ,"));
	// ...
});

Browse a data point to find all the sub data points.