tiny icon indicating copy to clipboard operation
tiny copied to clipboard

`collection.remove` removes documents from memory, but not from disk.

Open guiprav opened this issue 11 years ago • 0 comments

Hi, I'm using version 0.0.10 of the library and this is happening:

$ node
> tiny = require('tiny')
> tiny('./docs.tiny', function(e, docs_) { docs = docs_ })
> docs.each(console.log)
{ _key: 'doc-1', number: 1 } 'doc-1'
{ _key: 'doc-2', number: 2 } 'doc-2'
{ _key: 'doc-3', number: 3 } 'doc-3'
> docs.remove('doc-1', console.log)
[Prints "null," so no errors occurred.]
> docs.each(console.log)
{ _key: 'doc-2', number: 2 } 'doc-2'
{ _key: 'doc-3', number: 3 } 'doc-3'

So far, so good. Now I quit the REPL and start over:

$ node
> tiny = require('tiny')
> tiny('./docs.tiny', function(e, docs_) { docs = docs_ })
> docs.each(console.log)
{} 'doc-1'
{ number: 2, _key: 'doc-2' } 'doc-2'
{ number: 3, _key: 'doc-3' } 'doc-3'

Is this a known issue?

Thanks.

guiprav avatar Jul 04 '14 16:07 guiprav