Java – couchbase: reads all documents from the bucket

Is there any way to read all the files from the bucket? It is an active bucket, and I also want to access newly created documents

function (doc,Meta) {
  emit(doc);
}

The reduction function is empty When I query a bucket like this Query (viewquery. From ("test1", "all")) Allrows() returns 0 results

Solution

For the problem of returning zero results, do you want to promote the view to production view? This is a common mistake The development view only views a small part of the data to avoid overburdening Try this first

In addition, if you can help, do not send out the entire document, especially if you view all the documents in the bucket You want to issue the document ID, and then if you need to get the contents of these objects, please perform get operation or batch operation I will provide you with a direct link to batch operations, but you have not explained the SDK you use and those SDK specific to SDK For example, this is an example of Java

Having said so much, I have questions about why you should do the equivalent of select * from the bucket Once you have this data, what are you going to do with it? What do you really want to do? Of course, there are many ways to solve this problem

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>