.NET QueryTimeout not found


#1

Hello -

I am trying to execute a simple N1QL query on a large DataSet. I am getting the below exception in my code
"The operation has timed out"

Below is the code snippet using .NET SDK
var queryRequest = new QueryRequest(n1QlQueryStatement);
Bucket.Query<T>(queryRequest);

Please let me know how I can change the timeout of a query programmatically?

I am running Couchbase Server 3.0.2-1603 Enterprise Edition
.NET SDK 2.0.3.0

Thanks!


#2

@kris_smarty -

You can set the Timeout on the QueryRequest object:

var query = new QueryRequest("SELECT * FROM `beer-sample` LIMIT 10")
               .Timeout(new TimeSpan(0, 0, 0, 60)); 

That should work.

-Jeff