Meteor-Community-Packages/Meteor-CollectionFS

Can I tombstone a record while deleting file from store?

andrewash opened this issue · 0 comments

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