Meteor-Community-Packages / Meteor-CollectionFS

Reactive file manager for Meteor
MIT License
1.05k stars 237 forks source link

Can I tombstone a record while deleting file from store? #1008

Open andrewash opened 6 years ago

andrewash commented 6 years ago

Hi! Thank you for writing and especially maintaining CollectionFS. It's been great in my project.

I have a Meteor app that syncs audio recordings with iOS clients. When a recording is deleted by a client, I want to update the record as { tombstone = true}, so that other clients still see the record when they ask for changes, and will know to delete their local copy. However this will create a bunch of "orphaned" files in the store, cluttering up the hard drive.

Is there a way to keep a record in a Collection-FS collection, but delete it's associated file from the store? I'm using the file-system as my store, in this case.

As a workaround, I may have clients infer that a record has been deleted on the server if it no longer appears in the list of records received from the server. That said, I'd still love to know if there's an easy way to do this with CollectionFS.

Be well, Andrew