json - CouchDB filtered replication with params -
json - CouchDB filtered replication with params -
i'm trying setup filtered replication in couchdb:
the filter utilize following:
function(doc, req){ if(doc._id == req.query.myid){ homecoming true; } homecoming false; }
to test filter create call:
get /people/_changes?filter=data/mobile&query_params={"myid": "1"}
the name of database "people" the design document filter "_design/data" and name of filter "mobile" and result:
{"results":[ ], "last_seq":126}
when had document id equals "1".
can tell me i'm wrong?
i think problem asking filtered list of changes. since there none result set empty. replication accepts post
requests only. check out example in couch db wiki.
{"source":"http://example.org/example-database","target":"http://admin:password@127.0.0.1:5984/example-database", "filter":"myddoc/myfilter", "query_params": {"key":"value"}}
json database filter couchdb replication
Comments
Post a Comment