diff --git a/src/github.com/couchbase/sync_gateway/db/design_doc.go b/src/github.com/couchbase/sync_gateway/db/design_doc.go index 79216a3288..3e071bc3eb 100644 --- a/src/github.com/couchbase/sync_gateway/db/design_doc.go +++ b/src/github.com/couchbase/sync_gateway/db/design_doc.go @@ -107,7 +107,8 @@ func wrapViews(ddoc *DesignDoc, enableUserViews bool) { return; delete doc._sync; meta.rev = sync.rev; - (` + view.Map + `) (doc, meta); }` + (` + view.Map + `) (doc, meta); + doc._sync = sync;}` ddoc.Views[name] = view // view is not a pointer, so have to copy it back } }