couchbase

Couchbase, reduction too large error

冷暖自知 提交于 2020-01-04 14:37:25
问题 On my work I using couchbase and I have some problems. From some devices data come to couchbase, and after I calling aggregate view. This view must aggregate values by 2 keys: timestamp and deviceId. Everything was fine, before I have tried to aggregate more then 10k values. In this case I have reduction error Map function: function(doc, meta) { if (doc.type == "PeopleCountingIn"&& doc.undefined!=true) { emit(doc.id+"@"+doc.time, [doc.in, doc.out, doc.id, doc.time, meta.id]); } } Reduce

Couchbase v6.0 : Update Document content without resetting Document Expiration (TTL) value

房东的猫 提交于 2020-01-04 05:59:10
问题 I am using.Net Couchbase SDK(CouchbaseNetClient Package) to create a new document and while doing so I set the expiry value for the document. The expiry(TTL) value sets properly and works fine too. Problem Statment- Once the document has been created, I need to update some of its content for which I am using N1QL. Here the problem arises, it resets the document expiry value to 0. Is there any way to not reset the document expiry while updating a document content. 回答1: Any mutation with N1QL

What is the key value storage in couch base

只谈情不闲聊 提交于 2020-01-04 02:53:25
问题 I am new with coucbase,i have some doubt regarding the key value storage in couchbase. Normally we store data as document. I need clarification for bellow queries , What is the difference between document type and key-value type? How can i achieve key - value storage ? Can you explain with a small example. what is the benefit of storing as key-value? 回答1: What is the difference between document type and key-value type? In Couchbase you can store any key/value pairs. At this level keys and

Twisted API for Couchbase not working with Python Tornado

不羁岁月 提交于 2020-01-03 20:11:09
问题 I'm trying to run a Tornado server with Couchbase 4.0 Developer preview. import tornado.web import tornado.httpserver import tornado.options import tornado.ioloop import tornado.websocket import tornado.httpclient from tornado import gen import os.path from tornado.options import define, options, parse_command_line import time #from couchbase.bucket import Bucket from twisted.internet import reactor from txcouchbase.bucket import Bucket from couchbase.n1ql import N1QLQuery, N1QLError from

How do I check if key exists in Couchbase?

泄露秘密 提交于 2020-01-03 18:36:13
问题 I've already thought of two methods which I don't really like: Call to touch(key, null) inside try..catch.. and return false from the catch section. But then I'm changing the ttl which is not good for me. Call to add(key, value) inside try..catch.. and return false from the catch section - This defects efficiency because I have to delete they key I've just unnecessarily added. BTW, my environment is PHP. Any suggestions? Thanks! 回答1: Couchbase has not provided an exists method at this time,

How to delete all items in the bucket?

匆匆过客 提交于 2020-01-03 17:01:18
问题 I was wondering how can i delete all the items in the Couchbase bucket. I'm using java client. I've tried to run client.flush() method. Flush is enabled on bucket. But it throws exception : Exception in thread "Temporary Flusher" java.lang.RuntimeException: Http Error: 401 Reason: Unauthorized Details: No reason given 回答1: There is a bug in CouchBase Server 2.0. Use the ClusterManager class with the Administrator credentials found here 来源: https://stackoverflow.com/questions/15966769/how-to

How can I groupBy and change content of the value in couchbase?

a 夏天 提交于 2020-01-03 05:08:20
问题 Exple : I have a result like this Result1 AFTER EMIT: Key-------------------------------value "2014/10/31" ----------------- {"A":a} "2014/10/31" ----------------- {"B":b} "2014/10/31"----------------- {"C":c} "2014/10/31"----------------- {"D":d} How can I output this new result from the previous one: Key-------------------------value "2014/10/31" -----------------{"Array":["A":a, "B":b, "C":c, "D":d]} Is there a way? Any help will be appreciated. Thanks 回答1: You can use Couchbase v3 new

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

PHP Memcache connects to couchbase but can't do anything else

本秂侑毒 提交于 2020-01-02 10:32:28
问题 I have a new CouchBase server set up on Windows 7, and Apache with PHP and php_memcache.dll configured correctly. I can connect to the server, but cannot get stats, or set any values. Any suggestions what I am doing wrong? I've turned the firewall off, but as I can connect to 11211, I think connectivity is OK, anyway? Here's a test script $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211) or die ("Could not connect"); var_dump($memcache); echo "<hr />"; $allSlabs = $memcache-

PHP Memcache connects to couchbase but can't do anything else

那年仲夏 提交于 2020-01-02 10:31:59
问题 I have a new CouchBase server set up on Windows 7, and Apache with PHP and php_memcache.dll configured correctly. I can connect to the server, but cannot get stats, or set any values. Any suggestions what I am doing wrong? I've turned the firewall off, but as I can connect to 11211, I think connectivity is OK, anyway? Here's a test script $memcache = new Memcache; $memcache->connect('127.0.0.1', 11211) or die ("Could not connect"); var_dump($memcache); echo "<hr />"; $allSlabs = $memcache-