# creating the view
var designDocContents =
@"{
""views"" : {
""all_docs"" : {
""map"" : ""function (doc, meta) {\n emit(doc.name, [doc.version, doc.type, doc.date]);\n }""
}
}
}";
var result = _cluster.CreateDesignDocument(_bucketName, "dev_all_docs", designDocContents);
From my Visual Studio Immediate window while debugging:
# trying to get the created view and read values from it
couchbaseClient.GetView("dev_all_docs", "all_docs").GetEnumerator().MoveNext();
false
couchbaseClient.GetView("dev_all_docs", "all_docs").GetEnumerator().MoveNext();
true
As you can see the exact same code line (couchbaseClient.GetView...) returns false on the first call and true on the second call. I've tried adding sleep after creating the view, but that did not fix it, so it does not seem to be a timing issue.
I found a question that seemed somewhat related: Couchbase .Net client library GetView caching issue But the following change from the questions answer did not fix it either:
couchbaseClient.GetView("dev_all_docs", "all_docs").Stale(StaleMode.False);