Closed Tobino closed 7 years ago
Hi everyone,
While I am trying to remove a document from a collection, Rxdb don't emit any change. Example :
var col; RxDB.create('heroesDB', 'memory') // create database .then(function (db) { return db.collection('mycollection', mySchema); }) // create collection .then(function (collection) { col = collection; collection .find() .$ // <- returns observable of query .subscribe(docs => { if (docs) { console.dir(docs); // change } }); collection.insert({users: [{name: 'one'}, {name: 'two'}]}); return collection; }).then((collection) => { collection.findOne({users: {$eq: [{name: 'one'}, {name: 'two'}]}}).exec() .then(documents => { if (documents) { console.log('remove'); documents.remove(); }; }); return collection; }).then((collection) => { setTimeout(function () { col.insert({users: [{name: 'three'}, {name: 'four'}]}); }, 1000); });
output :
Array[1] // change remove Array[1] // change
I was expecting a change on remove, with a 0 lenght document.
Error should be fixed with PR.
Fixed in version 2.0.4. Please upgrade.
Hi everyone,
While I am trying to remove a document from a collection, Rxdb don't emit any change. Example :
output :
I was expecting a change on remove, with a 0 lenght document.