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
0
votes
1 answer

In Couchbase How can we use group level in multi key get while querying a reduced view

I have a reduced view which i want to query using multiple keys. Since it is a reduced view so it is processing some data. When i query it with multiple keys but it is giving all reduced data separately for each key. Is it possible to get…
Vikrant Mahajan
  • 545
  • 3
  • 8
0
votes
0 answers

Couchbase - Failed to access the view

I have a bucket with more than 9M record. And I have 10 views on this bucket. I am getting documents from view by paging with couchbase-client:1.4.2 . I have already defined this view on that bucket so it should be ready for query. After querying…
erimerturk
  • 4,230
  • 25
  • 25
0
votes
1 answer

CBLQuery map/reduce for arrays property

I have an existing json structure like this stored in one document. How can I use CBLQuery map/reduce for the events array? { "_id": "subject:6688", "_rev": "29-d3aad012fc362578e8a9b652918f419d", "subjectId": 6688, …
angelokh
  • 9,426
  • 9
  • 69
  • 139
0
votes
2 answers

How to get the latest document in couchbase bucket?

I have a activity bucket in my couchbase-db and I need to retrieve the latest document for different types, My initial approach was this: Document Format : [ id , { val.time ,val.type, val.load } ] And then I wrote different views to Map a specific…
user1470618
  • 147
  • 2
  • 11
0
votes
1 answer

Couchbase composite keys search

I have the following array: array(3) { [0]=> string(8) "xp is 20" [1]=> string(19) "level between 9, 50" [2]=> string(20) "cars between 100,200" } First is field than is operator and after is the value searched for. My view is as follows: function…
Gabriel
  • 772
  • 1
  • 13
  • 37
0
votes
1 answer

Selecting Documents Which Property has Two given Values

I have the following documents stored in my Couchbase DB: { name:'first document', document_props:['final','received','sent'] } { name:'second document', document_props:['final','sent'] } Now I want to list all documents in which…
Francisco Spaeth
  • 23,493
  • 7
  • 67
  • 106
0
votes
1 answer

Composite views in couchbase

I'm new to Couchbase and am struggling to get a composite index to do what I want it to. The use-case is this: I have a set of "Enumerations" being stored as documents Each has a "last_updated" field which -- as you may have guessed -- stores the…
ken
  • 8,763
  • 11
  • 72
  • 133
0
votes
3 answers

Couchbase Views length - searching on multiple factors

Straight up, I have read: http://www.couchbase.com/docs/couchbase-manual-2.0/couchbase-views-writing-bestpractice.html and various other pages on Couchbase site, but the following question just bothers me still so I want to double check before…
Robin Rieger
  • 1,204
  • 1
  • 16
  • 37
-1
votes
1 answer

How to create a new document in Couchbase?

Anyone who know how to create a new document in Couchbase iOS implementation? Step 1: Create Couchbase Buckets Step 2: Create Document What next step? Please see attached. Please look at the documents I wanted to add: Screen shots…
-1
votes
2 answers

couchbase view using multiple keys to get result

I have the following document { "Credit_Amount": 99, "Acc_no": 138, "Job_No": "esmwga", "Source_No": "x", "Temp": 1017, "Document_No": "gaf", "Debit_Amount": 67, "User_Id": "xirbzsewiw" } and my map function is…
Legendary_Hunter
  • 1,040
  • 2
  • 10
  • 29
-1
votes
1 answer

Couchbase - get doc if value of key is empty (i.e. has length 0 )

I have a View in Couchbase that I use to retrieve my data. Simplified, my data bucket contains: { "id" : 123, "key" : "some value" }, { "id" : 456, "key" : "" } ... and I want to get all the docs where 'key' is present, but its…
ocramot
  • 1,361
  • 28
  • 55
-2
votes
1 answer

Which is the Best Performing approach to find data using Views or N1sql

I am building a PHP application using CouchBase (mostly), but still not completely clear on the best approach for fetching contents. There are 2 different ways to get data (if I am correct) Using View functions Querying Data with N1QL That mean I…
tradebel123
  • 435
  • 1
  • 5
  • 20
-3
votes
1 answer

Couchbase dynamic views with different keys

I have an issue with Couchbase. I don't know ahead of time the keys on which the query is made. What solutions is Couchbase offering me. Keep in mind that I have big data set, order of hundred of millions. EDIT: I want to do matchmaking on a…
Gabriel
  • 772
  • 1
  • 13
  • 37
1 2 3
13
14