开发者

Access Full Set View from client Couchbase Server 2.0 issue

When i go in the couchbase console it shows a partial subset by default, u can show the fullset by clicking on it, this happens trough a link. (Developer view) The weird thing is after publishing the view(Production view), and checking the link there i do get all the objects, but when i try and get them from the client trough client.getView("data","view") i only get the partial subse开发者_高级运维t instead of all objects.

I am using the CouchbaseClient in .NET, MVC3.


The Couchbase .NET client allows you to configure whether you're using development or production views through the client configuration. In the end, all that really does is prepend "dev_" to the view name, but it's part of the configuration rather than part of the code to allow runtime configuration without recompliation.

The best approach would be to use the actual design document name you're using within the Web UI. As you may know, you can have both a development and a production version of a design document at the same time. The two can differ, but you can only edit the views in the development design document.

Assuming you have the regular name for the design doc which contains the view in your code, you can add switch it to the development mode design doc in your App/Web.config as follows:

<couchbase>
    <documentNameTransformer type="Couchbase.Configuration.DevelopmentModeNameTransformer, Couchbase" />
    ...
</couchbase>

There are some other references on this over on the Couchbase wiki.

If you're not seeing the full response expected, and you're sure it's using a production design doc/view, then there may be another issue. Keep in mind, there is a little lag time between inserting/updating a doc and it being available in the view.


I found the problem, all i had to do was remove the following line from my config file:

documentNameTransformer type="Couchbase.Configuration.DevelopmentModeNameTransformer, Couchbase"

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜