derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 117 forks source link

Racer null document instead of deleting it #231

Closed mrThomasTeller closed 9 years ago

mrThomasTeller commented 9 years ago

http://dl.dropbox.com/u/79087675/20150729_0c69.png Just try to delete any document using racer

minicuper commented 9 years ago

It's not a bug it's a feature :)

ShareJs should have a way to undo operations so it doesn't del docs to reserve the ids.

mrThomasTeller commented 9 years ago

@zag2art but if I want to have unique indexes in MongoDB collection? They break down ShareJS.

mrThomasTeller commented 9 years ago

@zag2art Do you know, when ShareJS deletes empty documents completely?

minicuper commented 9 years ago

Do you know, when ShareJS deletes empty documents completely?

Never, If you want to do this you should do it manually. F. e. you can use server hook to catch the del-operations and use mongo native driver to remove the docs completely - (see https://github.com/derbyparty/derby-hook del hook)

mrThomasTeller commented 9 years ago

@zag2art but if I want to have unique indexes in MongoDB collection? They break down ShareJS.

I found that I should just add option "sparse" to unique index

minicuper commented 9 years ago

I found that I should just add option "sparse" to unique index

Great

mrThomasTeller commented 9 years ago

Thank you! I guess it should be added to documentation if it wasn't.