Hi,
Trying to figure out how to migrate the use of Query from 2.x to 3.x
I am noticing that 2.x method uses IViewQuery, where 3.x is just a string.
IViewResult<T> Query<T>(IViewQuery query)
Task<IQueryResult<T>> QueryAsync<T>(string statement)
Need a way to convert the IViewQuery parameter from 2.x into a string statement that 3.x can use in the parameter.
What is the best route/method in doing this?
Example 2.x Usage:
var all = CouchBaseClient.Query<dynamic>("AccountAction", CouchBaseClient.CreateQuery("AccountAction", "type", "type").
StartKey(new object[] { "qbo" }).
EndKey(new object[] { "qbo", new { } })
.Reduce(false)
.Stale(Couchbase.Views.StaleState.False)
//.Limit(100)
);
if (!all.Success)
{
throw all.Exception;
}
return all.Rows.Select(q => q.Id.Replace("_qbo", "")).ToArray();
Thanks,
Brian Davis