如何使用C#从数据桶中获取所有文档? [英] How to get all documents from the data bucket using c#?

查看:69
本文介绍了如何使用C#从数据桶中获取所有文档?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从数据桶中获取所有文档?

How can I get all the documents from the data bucket?

我尝试了一个示例,但是我只能得到一个特定的文档.这是我的代码:

I have tried a sample but I'm able to get only a specific document. Here is my code:

CouchbaseClient oclient;

oclient= new CouchbaseClient("vwspace", "");// data bucket name

var results = oclient.Get("205");// document id

如何获取所有文件?

var results = oclient.? //what should i use here to get all documents

推荐答案

使用Couchbase Server 2.0,您将使用视图来获取所有文档.您的视图如下所示:

Using Couchbase Server 2.0, you would use a view to get all documents. Your view would look like:

function (doc, meta) {
   emit(null, null);
}

此视图将使您可以访问所有ID(ID始终包含在非精简视图查询结果中).

This view will give you access to all of the ids (id is always included in non-reduced view query results).

有关.NET中视图和查询视图的更多信息,请参见 http://blog.couchbase.com/strong-typed-views-net-client-library .

For more on views and querying views in .NET, see http://blog.couchbase.com/strongly-typed-views-net-client-library.

这篇关于如何使用C#从数据桶中获取所有文档?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆