1 possible answer(s) on “Update

update

Hello,
Thank you for the great tool!

I have а question about document update (I use it in node-webkit).

I have a collection of documents like {“test”: 1}.
I try to update a document (I want to add options array to it):

datastore.update(
    {_id: 'Ggw6ck1vDoasn5eP'}, 
    {
        "test": 'a',
        "options": [
            {'aaa':1}
        ]
    }, 
    {}, 
    function (err, newDoc){
    console.log(err);
});

It doesn’t fail but it adds a record with the same _id value,
so database file has 2 identical _id values.

Please advise.

Thanks,
Miriam

1 possible answer(s) on “update

  1. Haha I just spent two whole days debugging my code desperately trying to figure out why rows were being duplicated. I should’ve read the docs more carefully!