diff --git a/README.md b/README.md index 9177a86..b33f04c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,16 @@ It's a subset of MongoDB's API (the most used operations). The current API will * Indexing ### Creating/loading a database +You can use NeDB as an in-memory only datastore or as a persistent datastore. + ```javascript +// In-memory only datastore +var Datastore = require('nedb') + , db = new Datastore(); // Call the constructor without any argument +// No need to call loadDatabase(), you can begin inserting data and query it right away + + +// Persistent datastore var Datastore = require('nedb') , db = new Datastore('path/to/datafile'); @@ -34,6 +43,7 @@ db.loadDatabase(function (err) { // Callback is optional // err is the error, if any }); + // Of course you can create multiple datastores if you need several // collections. For example: db = {};