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

IF statement in Couchbase Map of view - I'm sure I'm missing something simple

I'm trying to limit the map in my view to a specific set of documents by either having the id "startsWith" a string or based on there being a specific node in the JSON> I can't seem to get a result set once I add an IF statement. The reduce is a…
1
vote
0 answers

How to perform “Document Access Removal Behavior”

I went through this document, but unable to remove document access on the sync gateway. FYI: I'm using Couchbase Lite 2.8.6 on the mobile (Xamarin SDK) Document { "channels": [ "3a7c15ba2241" ], "docType": "logentry", "creator":…
TheDeveloper
  • 1,127
  • 1
  • 18
  • 55
1
vote
0 answers

How to create hierarchical view in Couchbase

I have company documents in a bucket. I want to make a view of the company tree using those documents. How to achieve this using couchbase. I have checked this…
1
vote
1 answer

Has include_docs been removed from the Couchbase Node SDK?

In the Couchbase SDK 2.x for Node, you could use .include_docs(true) on a ViewQuery to retrieve the matched documents alongside the data emitted by the view. I don't see this option in the 3.x SDK, nor can I find it in the documentation. Has it…
Mike Hall
  • 25
  • 1
  • 4
1
vote
0 answers

I have list of student exam detail in Couchbase bucket. Now I have to fetch student list grouped by their class and sum of each subject and total

I have done this using query but as I have a large amount of data it takes more time. Now I have to pick the data in lesser time using design documents or Indexes. Kindly suggest which will be more efficient and execute with sorter time? Here is an…
Kartik Raja S
  • 668
  • 5
  • 18
1
vote
0 answers

Querying Couchbase view for single key with multiple values

I have document like below and i want to implement filter based on type in the range of timespan { fruit : Mango , timestamp : sometime , ...}, { fruit : Apple , timestamp : sometime , ...} { fruit : Grape , timestamp : sometime ,....} My View's…
saravana
  • 331
  • 1
  • 5
1
vote
1 answer

How to do post filter with couchnode / couchbase server?

I've been developing using Couchbase Server 4.0 and upgrading to 5.0 is down the road but not at the moment. But for now I do need to search views (map/reduce) using text search, on Couchbase Lite .Net there is PostFilter that serve the purpose.…
Chinh Nguyen
  • 583
  • 1
  • 7
  • 14
1
vote
0 answers

Large number of KV operations(insert, upsert) on a couchbase bucket leads to concurrent.timeout.Exception

I am trying to insert/upsert documents into couchbase database using Java JDK client 2.4.7 and couchbase server 5.0.1. The couchbase cluster is setup on AWS EC2 with 6 data nodes of type m4.2xLarge and two index/query nodes of type m4.xLarge. The…
Onkaar Singh
  • 10,187
  • 3
  • 14
  • 26
1
vote
2 answers

Couchbase Index and N1QL Query

I have created a new bucket, FooBar on my couchbase server. I have a Json Document which is a List with some properties and it is in my couchbase bucket as follows: [ { "Venue": "Venue1", "Country": "AU", "Locale": "QLD" }, { "Venue":…
The_Chud
  • 991
  • 1
  • 11
  • 24
1
vote
0 answers

hbase rowkey filter on multiple values

I have created an Hbase table rowkey with combination of multiple column values. my data of rowkey in hbase look like below. '123456~raja~ram~45000~mgr~20170116' '123456~raghu~rajan~65000~mgr~20150106' i am trying to filter condition just like in…
sri
  • 29
  • 1
1
vote
1 answer

Couchbase Sync-Gateway View Index Failure

I'm using Couchbase to power the back end of my mobile app and am experiencing a strange error when using views. I have a view set up to fetch a specific document type and am querying that view via the Sync-Gateway admin API. Normally it works well…
Rob Sanders
  • 5,197
  • 3
  • 31
  • 58
1
vote
1 answer

Sorting and querying documents in couchbase-lite android

What I want to do is finding all records that match some id and sorted by a name. The data looks something like: { type:"receiving", saleName:"Harshitha", penId:"7aac88118420858d62f5ea55e22" } { type:"receiving", saleName:"Tom", …
Harshitha Palihawadana
  • 2,171
  • 2
  • 15
  • 20
1
vote
1 answer

Couchbase Lite - Sorting Map/Reduce by values

Advertissement: I'm using CouchbaseLite Android 1.4.0 and I'm not ready to switch to 2.0. To get the context of my issue: I have 2 doc types: PATIENT & VISIT A patient is linked to a visit by a field visitId A visit has a startDateTime and a…
MHogge
  • 5,408
  • 15
  • 61
  • 104
1
vote
2 answers

How to iteratively store and retrieve JSONArray which contains nested JSON objects in couchbase (Android)

Trying to store a JSON array into Couchbase using this code in Android, put it is unsuccessful. Please help with how to successfully store it and also how to iteratively receive all data. Looked through the Couchbase documentation, but still stuck.…
fritz-playmaker
  • 693
  • 1
  • 10
  • 15
1
vote
1 answer

Create views for documents in Couchbase using ruby

I have Couchbase where documents are stored in json format like QueueMessage/abc123 QueueMessage/pqr456 and content in this for QueueMessage/abc123 { "queue_list": { "type": "cards.create", "id": "abc123", "userId": "abcd", …
Mag
  • 49
  • 2