Questions tagged [couchbase-view]

Couchbase views allow you to extract specific fields and information from data and create an easily accessible index.

The purpose of a view is to take the unstructured or semi-structured data stored within your Couchbase Server database, extract the fields and information you want, and produce an index of the selected information. Storing information in Couchbase Server using JSON makes the process of selecting individual fields for output easier. The resulting structure that is generated is a view on the stored data. The view that is created during this process lets you iterate, select, and query the information in your database from the raw data objects that have been stored.

Common pitfalls when using views:

  • Do not return entire docs using views. Rather, use the “attach doc” flag. Another solution is to emit just the object IDs and then do a parallelized bulk operation to get all of the relevant objects.
  • Views work only on data that has been persisted to disk
  • Views may return docs with expired TTL
  • Publish your view or else you may receive partial data
  • Do not use too many views – if you need to use more than 10-15 views, you should instead use N1QL or create a standardized key pattern to access your data via the key

Resources:

208 questions
1
vote
1 answer

How to order results from CouchbaseViewQuery on Couchbase PHP SDK 2.0?

I started studying both Couchbase and MongoDB to decide wich one to implement on a social network, but the lack of documentation on couchbase side is almost making me give up. Almost everything I must guess, as documentation are poor, and easier to…
valter
  • 418
  • 9
  • 24
1
vote
0 answers

Couchbase Database android - Delete a row from Document

I am having a problem with delete a specific row from Document. Prepare Database and Document Object, and save the data using document update method. In doc, there is method to delete a document but I am not getting how to delete a view/row using…
Slk
  • 205
  • 5
  • 12
1
vote
1 answer

Is it possible to re-order view values by using map reduce?

I need to reorder the coiuchbase views results based on the values.I am writing a map reduce like below and did sorting using group, reduce and descending keys. function (doc, meta) { if(doc.transactionType=='Transaction') { for(var i=0;…
user4319304
1
vote
0 answers

Filter by a second element of composite key in Couchbase

I have two fields a & b, I have created a view with emit([doc.a, doc.b]) Now I want to search only by field b, how can I do that. I tried startKey = ["", 48], endKey = [{}, 49], but this gives incorrect results,, it just totally ignores the second…
Sumit Jain
  • 1,484
  • 2
  • 25
  • 44
1
vote
1 answer

Retrieving documents from couchbase view using REST API

I'm starting with couchbase 3.01 and I have a question about views. The documentation I read said you should not include the full document in the index, as it will have a negative impact on both storage and performance. Now I've created a mapping…
Jason
  • 15,915
  • 3
  • 48
  • 72
1
vote
2 answers

How "keys" and "key" filters should be used in Couchbase to filter view results?

I have issue with key and keys filter parameter in Couchbase (Version: 3.0.0 Enterprise Edition) in the web console. Whatever value I set in those parameters, no record is returned. Documents look like: { "folder": "F3", "ccy": "USD", …
1
vote
2 answers

Couchbase Views in Cluster inconsistency

When I query a view from a Couchbase cluster, will each machine return the same result for the view query? I would expect the cluster to return the same response regardless of which machine actually responds to the request.
doron aviguy
  • 2,554
  • 2
  • 22
  • 18
1
vote
1 answer

Couchbase development view doesn't show results until published to production

I've created a very simple development view on my production Couchbase server function (doc, meta) { if (meta.id.indexOf("user:") == 0) emit(meta.id, doc); } This view doesn't return any results. Testing the same view on my local couchbase server…
Lior
  • 7,845
  • 2
  • 34
  • 34
1
vote
1 answer

Couchbase view custom reduce

i'm not sure if the title of the questions fits, if you know a better one, let me know ;) I just named it like this, because i'm thinking if i could solve my problem with a custom reduce function. I have two types of objects: Vehicles: { "id":…
Igl3
  • 4,900
  • 5
  • 35
  • 69
1
vote
1 answer

Couchbase MapReduce performance

We have been doing development on a new project for several months on Couchbase and while we've done a number of views, we just recently introduced our first reduce. The reduce function is operating on an index that is less than 100 rows, yet…
ski_junkie
  • 617
  • 1
  • 7
  • 14
1
vote
2 answers

Couchbase: Add View to existing Design Document

I can query the views of a design document. I can create a brand new design document. I can delete a design document. I can add a view to a design document I'm in the process of creating but... How do you add a view to an already existing design…
wheaties
  • 35,646
  • 15
  • 94
  • 131
1
vote
1 answer

Couchbase Create Group Query View error

In Couchbase I have list of documment in format: { "article_id": "107485", "domain": "thethao.langthuma.mr", "category_alias": "langthuma-anh-the-thao", "ip": "113.170.188.166", "process_time": "635411909410581019", "created_at":…
Sonrobby
  • 3,112
  • 8
  • 30
  • 38
1
vote
1 answer

Couchbase view index update hanging after adding file over ~1.4mb

I'm using the latest Couchbase .Net SDK and I'm having problems with larger JSON-documents (over 1.4mb) in views. In the case these documents were there when the design doc was added, the large files are just not shown in the view results (amount of…
the_jov
  • 185
  • 1
  • 2
  • 8
1
vote
1 answer

CouchBase Server use-case: grid with fresh data impossible?

we're facing a common use-case which seems "impossible" to solve with CouchBase server.... Basically in our web app we need to implement grids showing FRESH data (with all newest/updated documents present!) EX: User creates a new "order" in a…
1
vote
1 answer

Views in multi-node Couchbase cluster explained

I am new to Couchbase. I have a 2 node Couchbase environment, and I have 20 documents (Articles in my application) stored in a bucket. I believe that there are 5 articles living physically in node 1 and the others are living in node 2 because when I…
NextStep
  • 1,035
  • 3
  • 14
  • 18