remoteDb = new PouchDB('http://remote.com/db')
remoteDb.put({
"_id": "_desing/my_filter_doc_name",
"filters": {
"my_filter_name": "function(doc, req) { return doc.user_id === req.query.user_id }"
}
})
localDb = new PouchDB('local_db')
localDb.replicate.from(remoteDb, {
filter: "my_filter_doc_name/my_filter_name",
query_params: {
user_id: "xxx"
}
})