Deleting attachment file blobs but keeping metadata

We have a use case where our clients are streaming data from a device over bluetooth to a mobile phone where the data is being saved as attachments in couchbase lite. Then, once the recording is finished, the attachment blob is sent to a file storage server on the cloud. Once that is complete, the file should be deleted on the mobile phone in order to save space. However, we still require the attachment metadata in the database in case the user wants to look at historical recordings, in which case we will pull it from the server as required, while referencing the metadata in the database.

My question is: is there a way of deleting attachment “files” but keeping the metadata, without the system breaking?

I’m not sure the attachment API is entirely appropriate in this case. Perhaps you could just save the file in some location while you upload it and then once it is complete add the URL of the file into your doc. This can be tweaked to allow for caching on the device, etc, but the basic premise is a lot less awkward than creating an attachment just to immediately try to delete the data behind it.

Yeah that makes sense. We’ll probably roll our own in this case. Thanks!