「サンプル」という名前のデータベースがあります
次のような _design doc があります。
{ "_id": "_design/orgFilter",
"_rev":"9-7cd70d5ca52ddd42a3ff953c01d7cd36",
"views": {
"newView": {
"map": "function(doc) {
if(doc.type && doc.type==='organization' ){
emit(doc._id, doc.name);
}
}"
}
},
"language": "javascript"
}
そして、次のようなサンプルデータ:
{ "_id": "eb425729d084d49c8cddd45c6e00b07f", "_rev":
"2-9035a8eb3fa0fef44b0927bbe7090bbd", "type": "organization",
"name": "org1" }
{ "_id": "eb425729d084d49c8cddd45c6e00b2a7", "_rev":
"3-cf39cb747db01a4a71e58c2211de7c04", "type": "organization",
"name": "org2" }
{ "_id": "eb425729d084d49c8cddd45c6e00bf37", "_rev":
"3-d263492888a5755e91788901e59756ad", "type": "organization",
"name": "org3" }
私のノードサーバーでは、 nano db を使用し、 filter でレプリケーション機能を使用してみます。次のようになります。
nano.db.replicate('sample','http://localhost:5984/'+'b_rep',
{create_target: true,continuous:true,filter:"orgFilter/newView"} , function (err, body) {
if (!err)
console.log(body);
});
この操作の応答は次のとおりです。「json キーがありません: newView」
このフィルターを複製するにはどうすればよいですか?
ありがとう