node-json-db
Advanced tools
Comparing version
{ | ||
"name": "node-json-db", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"description": "Database using JSON file as storage for Node.JS", | ||
@@ -5,0 +5,0 @@ "main": "./JsonDB.js", |
@@ -128,2 +128,14 @@ [](http://travis-ci.org/Belphemur/node-json-db) [](https://coveralls.io/r/Belphemur/node-json-db?branch=master) | ||
``` | ||
#### Appending in Array | ||
```javascript | ||
//You can also easily append new item to an existing array | ||
//This set the next index with {obj: 'test'} | ||
db.push("/arraytest/myarray[]", {obj:'test'}, true); | ||
//The append feature can be used in conjuction with properties | ||
//This will set the next index as an object {myTest: 'test'} | ||
db.push("/arraytest/myarray[]/myTest", 'test', true); | ||
``` | ||
### Exception/Error | ||
@@ -130,0 +142,0 @@ JsonDB use 2 type of Error/Exception : |
@@ -348,3 +348,2 @@ var expect = require("expect.js"); | ||
expect(array).to.be.an('array'); | ||
console.log(array); | ||
var index1 = db.getData('/arraytest/appendArray2[1]/test'); | ||
@@ -351,0 +350,0 @@ expect(index1).to.be(1); |
43223
0.84%183
7.02%788
-0.13%