Document update on couch base server not synced

Hello,

I’m working with a couchbase lite database on some clients and I want to update some documents directly on the couchbase server and to see modifications on all the clients synchronized on this server.

But if I do a modification directly with couhbase admin page, the modifications are not synchronized to the couchbase lite databases and on the sync gateway, when I search this document, I have this text " Document with ID “” will be created on save.".

Where I did a mistake ? What I have to if I want to update a document in the couchbase server and to see modifications on all couchbase lite database ?

Regards,

Do you have enable_shared_bucket_access and import_docs set to true?

https://docs.couchbase.com/sync-gateway/current/sync-with-couchbase-server.html

Yes, both parameters are set with true value :frowning:

On sync_gateway admin page, if I go directly to the RAW document URL, I have this response : {“error”:“not_found”,“reason”:“Not imported”}


edit :
I already have some data in couchbase server synchronized with the sync gateways and couchbase mobile (and some of them are already imported thanks to the import_docs’s sync_gateway property) and I want to proceed to some modifications of these data directly in the couchbase server. Is it possible?

Another way to explain my question:
This worlflow works well [couchbase lite] <=> [syncgateway] => [couchbase server]
This worlflow doesn’t work [couchbase lite] <=> [syncgateway] <=> [couchbase server] (except for import where new data are well imported)

Found !
This works only for data managed with sync function in the sync_gateway ! Am I right?

I have two sets of data in the couchbase database :

  • set 1 : data imported from another system (managed with the sync function in the sync_gateway )
  • set 2 : data created/updated with client application (not managed with the sync_function in the sync_gateway)

I was trying to update a data from the set n°2 directly in the couchbase server. If I add a property in this data, in order to be managed by the sync function in the sync_gateway, then the data is well synchronized !

Glad you sorted it. Yes, you’re correct - everything SG attempts to import is run through the sync function as a normal mobile document update (as an admin user), so if there’s something in your sync function that prevents those documents from being successfully run through the sync function, that would be why you’re not seeing them be imported.

Ok, thanks for confirmation :slight_smile:

Regards,