Update methods don't seem to work
Closed this issue · 2 comments
davidjamesstone commented
var db = PicoDB.Create()
db.insertOne({ a: 1 }, function (err, doc) {
db.updateOne({ a: 1 }, { c: 'aaa' }, function (err, doc) {
db.find({}).toArray(function (err, docs) {
console.log(docs)
})
})
})
=> [ { _id: '...', a: 1 } ]
I expected the inserted document to be updated with { c: 'aaa' }
? Am I missing something?
FYI - using the 0.8.1
version from npm
Cheers
jclo commented
@davidjamesstone
I introduced a regression on the update method when a doc. is replaced by a new one (no operator). It is fixed in 0.8.2.
davidjamesstone commented
Thanks @jclo - can confirm this now works.
Great work BTW.