1

I am new in couchbase, I am using Couchbase server and sync gateway. Trying to write a webhook for document update in couchbase server. When I am changing document manually from server admin section no webhook is not calling. Is webhook work for couchbase server document update? What I am missing?

Just getting one warning in console after update:

changeCache: Doc "3423423423423" does not have valid sync data-db.(*changeCache).DocChanged at change_cache.go:448
Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
  • I'm not sure what you mean by 'webhook' in regards to Couchbase Server. Have you written an *eventing function* on Couchbase Server? If so, can you post the code for that? – Matthew Groves Apr 30 '20 at 15:58
  • Thanks for reply, eventing not abailable in community version,available in enterprise edition so I am trying to use sync gateway for couchbase server. After update in couchbase server call web url. – NodeJs-Explorer Apr 30 '20 at 16:24
  • What web url are you calling and from where? Are you call a url from your own code after updating/inserting data into couchbase server? – Matthew Groves Apr 30 '20 at 20:05
  • Oh, you're defining a webhook in Sync Gateway (https://docs.couchbase.com/sync-gateway/current/server-integration.html), but it's not executing when you directly put data into Couchbase Server, is that the problem? – Matthew Groves Apr 30 '20 at 20:10
  • 1
    Yes, Exactly. I have created a json file and run it from command line by sync_gateway sync-gateway-config.json(https://docs.couchbase.com/sync-gateway/current/config-properties.html#databases-foo_db-event_handlers) – NodeJs-Explorer Apr 30 '20 at 21:25
  • 1
    It is working now. I had to add "enable_shared_bucket_access": true, "import_docs": true in configuration json file of Sync gateway of couchbase. Thanks for your time. – NodeJs-Explorer May 01 '20 at 06:27

0 Answers0