couchbase-view

Couchbase view on multiple columns with WHERE and ORDER BY clause as in SQL

我是研究僧i 提交于 2020-01-02 17:54:31
问题 I am new to Couchbase noSql database. I am trying to create a view, i want this view should give result as below SQL query. SELECT * FROM Employee e WHERE e.name = "DESM%" AND e.salary < 1000 ORDER BY e.id desc Any suggestion is very appreciated. 回答1: If you look at existing beer samples in Couchbase (it comes with it), you will find views defined there. In admin console you can run a view. Notice when you run a view you can provide filtering criteria and sort order for the result...that

Using N1QL with document keys

佐手、 提交于 2019-12-24 16:12:04
问题 I'm fairly new to couchbase and have tried to find the answer to a particular query I'm trying to create with not much success so far. I've debated between using a view or N1QL for this particular case and settled with N1QL but haven't managed to get it to work so maybe a view is better after all. Basically I have the document key (Group_1) for the following document: Group_1 { "cbType": "group", "ID": 1, "Name": "Group Atlas 3", "StoreList": [ 2, 4, 6 ] } I also have 'store' documents, their

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

亡梦爱人 提交于 2019-12-24 12:45:16
问题 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 documents given by view is smaller than actual amount). If I add these larger files (using .Net client) later on, after design doc is created in the bucket, and getting the view with stale=false, the updating of the index never finishes and the

Is Couchbase Lite meant for Querying Data?

杀马特。学长 韩版系。学妹 提交于 2019-12-24 01:26:00
问题 We are looking at implementing Couchbase for an iPad App built with Xamarin.IOS. This is the first time we are digging into Couchbase and wanted to make sure that our use case is something that is doable with Couchbase. Our primary use case is to be able to query the data stored in the NoSQL database. Views seem like the only way to do this. It seems strange that the actual document cannot be queried directly like other NoSQL databases like MongoDB. Say our data is in the following format: {

Couchbase - return distinct values

二次信任 提交于 2019-12-12 15:24:16
问题 I have a list of small JSON documents in the format: { "name":"Kate", "event":"read" }, { "name":"Jon", "event":"delete" },... My map function is this: function(doc, meta){ emit(doc.event, null); } As a result I get a list of all events, including duplicates. How do I reduce the resultset to distinct values only? Thank you 回答1: This is the answer from the other question, modified to suit this question. I hope this helps someone! The reduce function: function(keys, values, rereduce) { return

Composite views in couchbase

倾然丶 夕夏残阳落幕 提交于 2019-12-11 14:05:48
问题 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 last time that the field was updated I want to be able to show only those enumerations which have been updated since some given date but still sort the list by the name of the enumeration I've created a Couchbase View like this: function (doc, meta)

Querying “Not In” in Couchbase

狂风中的少年 提交于 2019-12-11 03:42:47
问题 I have a set of documents in Couchbase where each may have some users as editors - a set of UserID`s in array. Id like to query all the docs where user with particular userid (username) is not in list of editors? here's what my data looks like: document1: {editors[1,2,3,4]} document2: {editors[1,2,3,4,5]} user{id:5} Regarding the data above - how can I query all the docs of type document where user with id=5 is not listed in editors array - meaning only document1 should return? 回答1: I can't

error (Reducer: ) when attempting to do distinct reduce

这一生的挚爱 提交于 2019-12-10 13:15:26
问题 I am getting an error when trying to do a DISTINCT reduce that I got from here. I have reproduced this error on the beer-sample bucket, so this should be easy to reproduce. I have not seen any errors in the mapreduce_errors.txt file, or anything that would lead me anywhere in the others. (If you would like me to search or post snippets of other files, please ask). Running couchbase enterprise 4 beta, on Windows 2008 R2 (This also happened on the 3.0.1 community edition as well.). Here is my

Couchbase view on multiple columns with WHERE and ORDER BY clause as in SQL

拈花ヽ惹草 提交于 2019-12-06 05:23:34
I am new to Couchbase noSql database. I am trying to create a view, i want this view should give result as below SQL query. SELECT * FROM Employee e WHERE e.name = "DESM%" AND e.salary < 1000 ORDER BY e.id desc Any suggestion is very appreciated. If you look at existing beer samples in Couchbase (it comes with it), you will find views defined there. In admin console you can run a view. Notice when you run a view you can provide filtering criteria and sort order for the result...that might be an equivalent for your SQL like functionality. Read more on Views and Indexes yet another option is to

max number of couchbase views per bucket

岁酱吖の 提交于 2019-12-03 12:55:26
问题 How many views per bucket is too much, assuming a large amount of data in the bucket (>100GB, >100M documents, >12 document types), and assuming each view applies only to one document type? Or asked another way, at what point should some document types be split into separate buckets to save on the overhead of processing all views on all document types? I am having a hard time deciding how to split my data into couchbase buckets, and the performance implications of the views required on the