You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request (didn't find any info on it in the documents)
Issue
I am looking for a way to upsert or atomicUpsert a document with an attachment in one go.
From my understanding right now I have to save a document and then do a put attachment (which is not atomic) and can potentially cause issues.
Info
Environment: browser
Adapter: IndexedDB/Localstorage
Stack: Typescript, React
Code
I am looking for something like this:
constfileAttachment={
id,// string, name of the attachment like 'cat.jpg'
data,// (string|Blob|Buffer) data of the attachment
type // (string) type of the attachment-data like 'image/jpeg'}constdocData={name: 'Bob',// primarylastName: 'Kelso',attachment: fileAttachment,};myCollection.upsert(docData);ormyCollection.atomicUpsert(docData);
The text was updated successfully, but these errors were encountered:
Hi @yahyavi
There is currently no way to do this with rxdb. You could of course use the underlaying pouchdb as workarround. Of course it would be nice if this was possible directly with rxdb.
I will not have time in the near future to implement this.
Do you have the time to create a PR?
Hi @pubkey,
I will try to have a look but right now I am running into a bug and I cannot create DBs anymore. Will open a separate issue here with a minimal repo to replicate.
Case
Feature Request (didn't find any info on it in the documents)
Issue
I am looking for a way to upsert or atomicUpsert a document with an attachment in one go.
From my understanding right now I have to save a document and then do a put attachment (which is not atomic) and can potentially cause issues.
Info
Code
I am looking for something like this:
The text was updated successfully, but these errors were encountered: