Document_changed vs new documents

Hi,

I’m cruising on CBLite 2.0 beta, SGW 2.0 beta and CBS 5.1

I want to configure the databases.foo_db.event_handlers.document_changed event handler. In short, I want to create the document on the couchbase server bucket of course but also post every non-existent document for creation in a MSSQL datbase.

I was wondering two things:

  1. is document_changed also fired with new documents that have no id existing in the bucket?
  2. is there a way to filter those new documents, thus documents with no pre-existence in the bucket?

Any ideas on this?

What platform are you talking about? I’m unfamiliar with event_handlers.document_changed. Is this something in a Couchbase Server SDK? If so, you should ask the question on the SDKs forum for whatever language you’re using.

He is referring to the Sync Gateway config param
https://developer.couchbase.com/documentation/mobile/current/guides/sync-gateway/config-properties/index.html#1.5/databases-foo_db-event_handlers-document_changed