We don’t recommend doing this. Use Sync Gateway’s REST API to add documents to the database. If you must add documents using Couchbase Server APIs, you’ll need to use the bucket shadowing feature. What you’ll really be doing then is writing to a separate bucket, which Sync Gateway then monitors and copies changes into its own bucket.