couchdb

CouchDB views erroring out

这一生的挚爱 提交于 2019-12-24 00:39:13
问题 I've been playing with CouchDB (and the RelaxDB ruby library) but creating a view and then trying to access it causes a nasty non specific error. I stepped back a step because I thought RelaxDB might be incompatible with the CouchDB version I'm using(0.8.1), but even when I create a new database and equivalent views and call it by manually hitting the URL it still doesn't work. [info] [<0.13529.0>] HTTP Error (code 500): {'EXIT', {function_clause, [{couch_httpd,handle_db_request, [{mochiweb

How to load balance/failover with pouchdb/couchdb?

送分小仙女□ 提交于 2019-12-24 00:36:30
问题 Just looking for info on what strategies people use for this? In the examples I see it is really easy to make a remote database connection that I will call get() on. var remoteDb = new PouchDB('https://myhost.com/db'); var data = remoteDb.get("myId"); But what if I have several remote databases set up that are syncing with each other. I want the clients to be able to use them all without changing the code. I am considering doing this through dns. For example have db.myhost.com with multiple

Submitting form to couchDB through update handler not working

99封情书 提交于 2019-12-24 00:28:59
问题 I can not post to CouchDB through an update handler and I do not know what I am doing wrong. Below follows the long description. I created an app using erica, with details taken primarily from the wiki. It worked fine until I decided to go for POSTing, but server-side, through an update handler according to Apache CouchDB wiki Working_with_Forms I created a new 'webapp' with erica, constructed an index (cut-n-paste from the wiki, with small alterations): <!DOCTYPE html> <html lang="en"> <head

CouchDB sign-in with AngularJS: auth cookie sent for /_session only

拈花ヽ惹草 提交于 2019-12-23 23:11:37
问题 Previous posts — 1 , 2 What I have now: AngularJS app with two controllers. First works with CouchDB documents and the second perform sign-in requests to example.com/demo/_session . When I open application, I can't do editing with couchdb (in first controller), because some actions I've limited to logged users only. In second controller I'm sending simple POST over $http , which return Http-only (so no cookie magic there) auth cookie AuthSession . That cookie bound to couchdb address and in

CouchDB's Linked Documents in a View

心不动则不痛 提交于 2019-12-23 20:45:24
问题 I'm having a hard time getting my head around CouchDB's linked documents feature. I have two types of data being stored in a single CouchDB database: { "id":"1", "type": "track", "title": "Bohemian Rhapsody" } { "id":"2", "type": "artist", "name": "Queen", "tracks": ["1"] } I'm under the impression that I can write a view like the one below and get the following documents emited: { "id":"2", "type": "artist", "name": "Queen", "tracks": [ { "id":"1", "type": "track", "title": "Bohemian

Resolve Pouch Couch DB

回眸只為那壹抹淺笑 提交于 2019-12-23 16:18:32
问题 I am developing a prototype website that works offline that utilises Pouch DB so that it syncs back up to a CouchDB on a server when it goes online. The Pouch DB conflicts guide says: To resolve the conflict, you simpy put() a new revision on top of the current winner. How do you do this? I have the tried the following functions but neither work as expected: function (current, chosen) { chosen._rev = current._rev; chosen._conflicts = []; db.put(chosen); }; function (chosen) {; db.put(chosen);

What JavaScript functions are available in the CouchDB map and reduce view functions?

烂漫一生 提交于 2019-12-23 16:11:40
问题 When writing map and reduce view functions for CouchDB in JavaScript, what are the build-in functions available? For example, various examples refer to the following 2 functions: emit(key, value) and sum(values) . Are there other functions like avg(values) available? Where can I find a full list of all functions available? 回答1: I don't know the CouchDB internals, however, from reading the sources, it looks like the map functions are evaluated in the sandbox created by init_sandbox(). So the

How to securely store my CouchDB admin password?

给你一囗甜甜゛ 提交于 2019-12-23 15:24:57
问题 I spent a long time yesterday to configure for my CouchDB instance in order to create a little app and letting CouchDB manage authentication and authorizations for me. So I ended up with something like that : On top of everything I've got a server admin, who basically is god on my CouchBD instance. Then I created a database named "mydatabase" (for example) and added the role "mydatabase_dba" as admin and also the role "mydatabase_user" as reader. I also created a database named "_users" which

In CouchDB, are there ways to improve performance of the View index process?

半腔热情 提交于 2019-12-23 13:33:14
问题 I have some basic views and some map/reduce views with logic. Nothing too complex. Not too many documents. I've tried with 250k, 75k, and 10k documents. Seems like I'm always waiting for view indexing. Does better, more efficient code in the view help? I'm assuming it's basically processing the view at all levels of aggregation. So there must be some improvement there. Does emit()-ing less data help? emit(doc.id, doc) vs specifying fewer fields? Do more or less complex keys impact view

CouchDB IP Address and Port

浪子不回头ぞ 提交于 2019-12-23 13:05:17
问题 When I start couchDB I have it running on http://127.0.0.1:5984/ . I have another program I need to run on the same port, so I want to change the couchDB one to something else. Any ideas? 回答1: Specify the port in your local.ini config: [httpd] port = 5984 来源: https://stackoverflow.com/questions/21785027/couchdb-ip-address-and-port