Let me illustrate the flow. ‘a’ means alpha symbol; ‘b’ means beta symbol in the illustrations
- User takes a picture. Our Xamarin program creates 2 new documents: ‘a’ and ‘b’. Both of them have a BLOB attachment created through Couchbase Lite (notice that the document icon has another little document icon inside). Notice that both of them have value 1AB2 in RelaField but the type is different: ‘a’ is newdoc while ‘b’ is doc.
- Both documents are propagated to Couchbase Capella.
- Connector.NET is a daemon asking every x seconds if there is any newdoc.
- In this case, the answer is ‘yes, ‘a’‘.
- So Connector.NET makes an API call with the data contained in ‘a’
- The API method inserts a new record in a Postgre table (a new id is created, let’s say 6589)
- Connector.NET deletes ‘a’ as it is already processed
- Connector.NET queries a table called Queue
- Connector.NET gets the newly created row with the new id (6589, as said in step 6)
- Connector.NET creates a new document in Couchbase Capella with id ‘document::6589’. Notice that it has no attachment
- Connector.NET gets the attachment of ‘b’.
The goal is that Connector puts attachment of ‘b’ into ‘document::6589’ and then deletes ‘b’(using RelaField to find a match). I see 2 options:
a) Move attachment from ‘b’ to ‘document::6589’.
b) Create a new attachment for ‘document::6589’ with the Stream get on step 11
Both options must be done using API as Connector.NET does not have CouchbaseLite.