Comparing version 0.6.0 to 0.6.1
@@ -205,2 +205,5 @@ var fs = require('fs') | ||
// In-memory only datastore | ||
if (!self.filename) { return callback(); } | ||
customUtils.ensureDirectoryExists(path.dirname(self.filename), function (err) { | ||
@@ -306,2 +309,5 @@ fs.exists(self.filename, function (exists) { | ||
// In-memory only datastore | ||
if (!self.filename) { return callback(); } | ||
self.datafileSize += newDocs.length; | ||
@@ -524,3 +530,2 @@ | ||
module.exports = Datastore; |
{ | ||
"name": "nedb", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "tldr.io", |
@@ -29,4 +29,13 @@ # NeDB (Node embedded database) | ||
### 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'); | ||
@@ -38,2 +47,3 @@ | ||
// Of course you can create multiple datastores if you need several | ||
@@ -40,0 +50,0 @@ // collections. For example: |
194798
4169
374