Skip to content

Instantly share code, notes, and snippets.

@MrTrick
Created September 9, 2010 06:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrTrick/571476 to your computer and use it in GitHub Desktop.
Save MrTrick/571476 to your computer and use it in GitHub Desktop.
filters.source:
function(doc, req) {
if(!req.query.source)
throw("Please provide a query parameter `source`.");
if (doc.source && doc.source == req.query.source)
return true;
else
return false;
}
curl -X POST http://admin:pw@amun4:5005/_replicate -d '{"source":"http://admin:pw@amun4:5005/cgm_test","target":"http://admin:pw@amun4:5005/cgm_test3","filter":"couchapp/source","query_params":{"source":"mps"}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment