anchor.diff:      {<<"filters">>, {[
           {<<"testfilter">>, <<"
               function(doc, req){if (doc.class == 'mammal') return true;}
  +        ">>},
  +        {<<"queryfilter">>, <<"
  +            function(doc, req) {
  +                if (doc.class && req.query.starts) {
  +                    return doc.class.indexOf(req.query.starts) === 0;
  +                }
  +                else {
  +                    return false;
  +                }
  +            }
           ">>}
       ]}}
   ]}).
  
positive.code:         {<<"value">>, 3}
  
      ]}),
      {ok, _} = couch_db:update_docs(Db, [DDoc, Doc1, Doc2, Doc3]),
      couch_db:ensure_full_commit(Db),
      couch_db:close(Db).
  
  
negative.code:         }
      }.
  
  query_filtered_replication_test_() ->
      Pairs = [{local, local}, {local, remote},
               {remote, local}, {remote, remote}],
      {
          "Filtered with query replication tests",
          {
              foreachx,
              fun setup/1, fun teardown/2,
              [{Pair, fun should_succeed_with_query/2} || Pair <- Pairs]
          }
      }.
  
  should_succeed({From, To}, {_Ctx, {Source, Target}}) ->
      RepObject = {[
          {<<"source">>, db_url(From, Source)},
  