Shailesh Uke

Shailesh Uke

  • 969
  • 807
  • 17.1k

How to Apply Filter Couchbase Server Using c#

Jun 8 2017 12:25 AM
My Json : _

{
"_id":"biking",
"_rev":"AE19EBC7654",

"type":"user",
"body":"My biggest hobby is mountainbiking. The other day...",
"date":"2009/01/30 18:04:11"
}

{
"_id":"biking",
"_rev":"AE19EBC7654",

"type":"testuser",
"body":"My biggest hobby is mountainbiking. The other day...",
"date":"2009/01/30 18:04:11"
}


var pull = _db.CreatePullReplication(syncGatewayUri);
var push = _db.CreatePushReplication(syncGatewayUri);

_db.SetFilter("byUser", (revision, filterParams) =>
{
var typeParam = filterParams["type"].ToString();

return (typeParam != null) && typeParam.Equals("USer");
});

pull.Filter ="byUser";

But not apply filter i want to get result that contain only type user