Couchdb 使用数据库筛选复制时未定义require

Couchdb 使用数据库筛选复制时未定义require,couchdb,pouchdb,Couchdb,Pouchdb,我在PockDB和CouchDB之间设置了一个双向复制,我想过滤复制,以便只有相关文档最终进入我的本地包 pouchDB('medic').sync('http://localhost:5984/medic', { live: true, retry: true, filter: 'medic/doc_by_place' }); 执行同步时,我从下面的匿名函数中获得未捕获引用错误:未定义require (function () { return function(){return

我在PockDB和CouchDB之间设置了一个双向复制,我想过滤复制,以便只有相关文档最终进入我的本地包

pouchDB('medic').sync('http://localhost:5984/medic', {
  live: true,
  retry: true,
  filter: 'medic/doc_by_place'
});
执行同步时,我从下面的匿名函数中获得
未捕获引用错误:未定义require

(function () { return function(){return require("lib/app")["filters"]["doc_by_place"].apply(this, arguments);} })()

这是从哪里来的?为什么
require
没有定义?

此错误来自
同步的“到”端,而不是“从”端。服务器端筛选器仅对来自调用的筛选器有效。要筛选复制,请执行

我最终将复制拆分为两个,如下所示

pouchDB('medic')
  .replicate.from('http://localhost:5984/medic', {
    live: true,
    retry: true,
    filter: 'medic/doc_by_place'
  });

pouchDB('medic')
  .replicate.to('http://localhost:5984/medic', {
    live: true,
    retry: true
  });