couchbase

How to rename a bucket in couchbase?

核能气质少年 提交于 2019-12-10 19:19:03
问题 I have a bucket name 0001 when I use the following N1QL statement I get a "5000" syntax error: cbq> Select * from 0001; { "requestID": "f2b70856-f80c-4c89-ab37-740e82d119b5", "errors": [ { "code": 5000, "msg": "syntax error" } ], "status": "fatal", "metrics": { "elapsedTime": "349.733us", "executionTime": "204.442us", "resultCount": 0, "resultSize": 0, "errorCount": 1 } } I think it takes 0001 as a number and not as a bucket name, is there an easy way to rename it? 回答1: In this case you can

Couchbase SDK and Moxi Client

允我心安 提交于 2019-12-10 19:04:45
问题 I am new to Couchbase and trying to understand why we need a Client side proxy like Moxi if using a Couchbase PHP SDK. As per my understanding the proxying of client requests to right server is done by the Client SDK which maintains the vBucket map of all keys. Why in case of a web application using PHP SDK and Couchbase, we need an additional Moxi client? 回答1: They are for two different things. Moxi is for when you want to use a standard memcached library as MOXI will proxy memcached calls

Connecting Couchbase sync adapter to couchdb server

走远了吗. 提交于 2019-12-10 18:04:58
问题 How do I connect the couchbase sync adapter to a couchdb server, the docs only say how to use couchbase server and then to use the "administrator console" which couchdb doesn't have, and when I run sync_adapter -url 192.168.1.xx/mydb it returns an error Before you say "it can't be done", here is a quote from the couchbase docs "Couchbase Lite can sync with servers running Apache CouchDB and with Couchbase Server via Sync Gateway." 回答1: Couchbase Lite is compatible with CouchDB replication,

Couchbase Multiple Keys

ぐ巨炮叔叔 提交于 2019-12-10 17:19:06
问题 I presume a simple question. I have the following data. I want to search for all rows where the ID is > 2 but < 8 and the Price is > 30 I have used various versions of: startkey=["2", null] or even something like startkey=["2", "30"] just for testing. It only ever seems to run both conditions on the first row. So if I do: startkey=["2", "30"] then I get back: {"id":"3","key":["3","30"],"value":null}, {"id":"4","key":["4","30"],"value":null}, {"id":"5","key":["5","20"],"value":null}, {"id":"6"

Insert into remote Couchbase server by Python

久未见 提交于 2019-12-10 17:17:00
问题 I use this code to insert data into Couchbase from couchbase import Couchbase c = Couchbase.connect(host="remote-server.com", bucket="default") c.set('first_key', 'first-_value') But I got this error: couchbase.exceptions.TimeoutError: <Key=u'first_key', RC=0x17[Operation timed out], Operational Error, Results=1, C Source=(src/multiresult.c,148)> And, I tried these steps: I printed c (Couchbase connection object) out The object was created so it connected to Couchbase server successfully? I

Writing a simple group by with map-reduce (Couchbase)

徘徊边缘 提交于 2019-12-10 16:39:51
问题 I'm new to the whole map-reduce concept, and i'm trying to perform a simple map-reduce function. I'm currently working with Couchbase server as my NoSQL db. I want to get a list of all my types: key: 1, value: null key: 2, value: null key: 3, value: null Here are my documents: { "type": "1", "value": "1" } { "type": "2", "value": "2" } { "type": "3", "value": "3" } { "type": "1", "value": "4" } What I've been trying to do is: Write a map function: function (doc, meta) { emit(doc.type, 0); }

How to set couchbase operation timeout in spring data couchbase?

前提是你 提交于 2019-12-10 15:59:19
问题 I have a simple spring project which try to retrieve a document from couchbase using spring-data-couchbase. I have configured the config by extending AbstractCouchbaseConfiguration. Everything works perfectly fine. Since I use couchbase as a cache, now I need to set the operation timeout to a lower value. Anybody can shed some light on how to do it? 回答1: To define a timeout for the CouchbaseClient you have to provide it using the ConnectionFactory. Sadly, the current version of spring-data

How do I keep existing data in couchbase and only update the new data without overwriting

吃可爱长大的小学妹 提交于 2019-12-10 14:55:15
问题 So, say I have created some records/documents under a bucket and the user updates only one column out of 10 in the RDBMS, so I am trying to send only that one columns data and update it in couchbase. But the problem is that couchbase is overwriting the entire record and putting NULL`s for the rest of the columns. One approach is to copy all the data from the exisiting record after fetching it from Cbase, and then overwriting the new column while copying the data from the old one. But that

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 connection timeout with Java SDK

谁说胖子不能爱 提交于 2019-12-10 13:15:22
问题 I followed the couchbase tutorial to connect to remote couchbase server, but it failed on connection time out after I try to open default bucket. I have checked that I can open couchbase server page on my computer(192.xx.xx.xx:8091) Here is my Java code CouchbaseEnvironment env = DefaultCouchbaseEnvironment.builder() .queryEnabled(true) .build(); Cluster cluster = CouchbaseCluster.create(env,"192.xx.xx.xx:8091"); Bucket bucket = cluster.openBucket("default",""); JsonObject user = JsonObject