petersirka / nosql

NoSQL embedded database for small node.js projects
Other
295 stars 48 forks source link

remove filter does not match #33

Closed celevra closed 7 years ago

celevra commented 7 years ago

Hi,

my remove filter seems like to not match, this is in my database:

cat positions.nosql
{"time":"2017-03-04T12:46:26.000Z","lat":49.563133333,"lon":10.918623333,"speed":0}

this is my code:

console.log('removing', position)
nosql.remove().make(function(builder) {
    builder.where('time', position.time);
    builder.callback(function(err, count) {
        if(err) console.log(err)
        else console.log('removed documents:', count);
    });
});

this is the output:

removing { time: 2017-03-04T12:46:26.000Z,
  lat: 49.563133333,
  lon: 10.918623333,
  speed: 0,
  cache: true }
removed documents: 0

no changes in the database am i doing something wrong?

regards

celevra

petersirka commented 7 years ago

Hi @celevra, yes, there was a bug (thank you for your report). I have fixed it. Please download latest beta version $ npm install total.js@beta.

Thank you!

petersirka commented 7 years ago

Sorry :-D I have fixed it in Total.js framework and now I have published a new version of NoSQL into the NPM with this fix $ npm install nosql.

celevra commented 7 years ago

thank you for your fast answer! works perfect, thanks for your work!