|
|
@ -117,7 +117,7 @@ An `_id` field will be automatically generated by NeDB. It's a 16-characters alp |
|
|
|
Field names cannot begin by '$' or contain a '.'. |
|
|
|
Field names cannot begin by '$' or contain a '.'. |
|
|
|
|
|
|
|
|
|
|
|
```javascript |
|
|
|
```javascript |
|
|
|
var document = { hello: 'world' |
|
|
|
var doc = { hello: 'world' |
|
|
|
, n: 5 |
|
|
|
, n: 5 |
|
|
|
, today: new Date() |
|
|
|
, today: new Date() |
|
|
|
, nedbIsAwesome: true |
|
|
|
, nedbIsAwesome: true |
|
|
@ -127,7 +127,7 @@ var document = { hello: 'world' |
|
|
|
, infos: { name: 'nedb' } |
|
|
|
, infos: { name: 'nedb' } |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
db.insert(document, function (err, newDoc) { // Callback is optional |
|
|
|
db.insert(doc, function (err, newDoc) { // Callback is optional |
|
|
|
// newDoc is the newly inserted document, including its _id |
|
|
|
// newDoc is the newly inserted document, including its _id |
|
|
|
// newDoc has no key called notToBeSaved since its value was undefined |
|
|
|
// newDoc has no key called notToBeSaved since its value was undefined |
|
|
|
}); |
|
|
|
}); |
|
|
|