couchbase

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

Nodejs error : libcouchbase.so.2: cannot open shared object file: No such file or directory

爱⌒轻易说出口 提交于 2019-12-11 03:41:25
问题 I am working on a nodejs project. Its working in my laptop but when I tried to run it in my desktop it is throwing error : libcouchbase.so.2: cannot open shared object file: No such file or directory Can anybody suggest me what could be the wrong? Thanks in advance 回答1: Maybe it could help somebody: Looks like the shared library should be in /usr/lib/libcouchbase.so.2 But the install script installed libcouchbase.so.2 to / usr/local/lib/libcouchbase.so.2. So I just linked it to /usr/lib

In Couchbase Java Query DSL, how do I filter for field-values that are not ASCII?

馋奶兔 提交于 2019-12-11 03:33:15
问题 Using Couchbase Java DSL, a query using "fish/piraña" gives a parse-error, but with "fish/piranha" , there is no parse-error. I had thought that the x() method would correctly wrap the non-ASCII Unicode string. Using N1ql directly, this does work with any field name (except blank) or field value: parameterized("SELECT * from " + bucket.name() + " WHERE " + fieldName + " = $v", placeholders)) How can this be done using the Java Query DSL? String species "fish/pira\u00f1a" ; Expression

Couchbase .Net client library GetView caching issue

孤街浪徒 提交于 2019-12-11 03:29:01
问题 I'm running couchbase server 2.0 (dev preview 4) and using .net client library version 1.2. When I add some document (json) to my database and then in few seconds (less then 10) I try to get this document via GetView through .net client library and it always returns old value on first query. Only on second query it returns actual value. When I exec same query through REST api, it returns actual value. Can anyone provide some information about this? 回答1: The default behavior of views in

How to create 2 nodes with backup, but without document balance

雨燕双飞 提交于 2019-12-11 03:01:48
问题 I have 2 couchbase nodes. One should backup the other, but I do NOT want the server to balance the documents between them. So I've tried to add them both to one cluster, and set replicas to "disable" on the bucket, but still it balance the documents between those 2 servers. Then I've tried to use the servers as different clusters with replication between them. I've also added in the client config those two servers: <servers bucket="default" bucketPassword="private"> <add uri="http://server1ip

Couchbase & Spring query error: “Query returning a primitive type are expected to return exactly 1 result, got X”

对着背影说爱祢 提交于 2019-12-11 02:46:49
问题 In our spring-boot 2.0.4.RELEASE application, we are using Couchbase version 5.5.1 build 3511 with Spring . We added a new delete method to the Repository interface: public interface CatRepository extends CouchbaseRepository<Cat, String> { long deleteAllByName(String name); When calling the method, documents are deleted from the bucket, but we get the following error: Query returning a primitive type are expected to return exactly 1 result, got X The X value is changed according to the number

How to query item's metadata from Couchbase?

廉价感情. 提交于 2019-12-11 01:49:14
问题 I put some data to CouchBase 1.8.1,and get it successful.But I want to query its metadata,as expiration and att_reason(non-json or json).In some document,it list the metadata with json format,for example: { "_id" : "contact_475", "_rev" : "1-AB9087AD0977F089", "_bin" : "...", "$flags" : 0, "$expiration" : 0, "name" : "Fred Bloggs", } How can I query item's metadata? 回答1: As Pavel the most common way to access metadata in Couchbase (2.0) is using Views. You can also use the internal TAP

How can I change default Couchbase item size?

本小妞迷上赌 提交于 2019-12-11 01:19:35
问题 I am using the .NET Couchbase Client API that includes Enyim.Caching. I have a DataTable that is approximately 55 megs and it is not getting cached. I understand that there is a "soft" max for the item size of 20 megs. How can I change the default max item size in order to cache this object? 回答1: Are you using a Memcached bucket or Couchbase bucket? If you're using a Memcached bucket then you're likely hitting the 1MB limit. A quick sample program: var config = new

N1QL Error Index scan timed out - cause: Index scan timed out

冷暖自知 提交于 2019-12-11 00:01:00
问题 I'm facing an issue on couchbase 4.1.0 running a query through CBQ against about 20 Million documents. When executing my query this error is printed after a 2 minute timeout: "code": 12015, "msg": "Index scan timed out - cause: Index scan timed out". My questions are this What is an index scan (is this a scan looking for the appropriate index to use or something? What causes such an error Is querying a dataset of this size beyond the capabilities of couchbase? 回答1: An index scan is the

Couchbase times out after few seconds

倖福魔咒の 提交于 2019-12-10 20:08:09
问题 I have about 100-200k small documents which contain base64 encoded images (quite small images). I am trying to insert all these documents to the Couchbase and I keep getting this error after first 28k documents (about 185 Mb total size) [Error: Client-Side timeout exceeded for operation. Inspect network conditions or increase the timeout] code: 23 Here is screenshot of Couchbase settings (I see only one strange thing here — free space is totally wrong, actually it is about 300GB of free space