couchdb

Pros/cons of document-based databases vs. relational databases

我怕爱的太早我们不能终老 提交于 2019-12-17 06:24:21
问题 I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me

Pros/cons of document-based databases vs. relational databases

依然范特西╮ 提交于 2019-12-17 06:23:12
问题 I've been trying to see if I can accomplish some requirements with a document based database, in this case CouchDB. Two generic requirements: CRUD of entities with some fields which have unique index on it ecommerce web app like eBay (better description here). And I'm begining to think that a Document-based database isn't the best choice to address these requirements. Furthermore, I can't imagine a use for a Document based database (maybe my imagination is too limited). Can you explain to me

Creating & using ContentProvider for android

拟墨画扇 提交于 2019-12-14 03:53:01
问题 When I call an Android ContentProvider I get the following exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{de.harm.android.couchone/de.harm.android.couchone.CouchContactClient}: java.lang.IllegalArgumentException: Unknown URL content://de.harm.android.couchone.provider/test2 These are the projects: https://github.com/der-harm/CouchOneProvider .../CouchOneContacts Android uses the so-called ContentResolver to communicate with ContentProvider which in turn handles

Is CouchDB per-user database approach feasible for users with lots of shared data?

孤者浪人 提交于 2019-12-14 03:40:05
问题 I want to implement a webapp - a feed that integrates data from various sources and displays them to users. A user should only be able to see the feed items that he has permissions to read (e.g. because they belong to a project that he is a member of). However, a feed item might (and will) be visible by many users. I'd really like to use CouchDB (mainly because of the cool _changes feed and map/reduce views). I was thinking about implementing the app as a pure couchapp, but I'm having trouble

Triple join in CouchDB?

╄→гoц情女王★ 提交于 2019-12-13 18:47:07
问题 I have three type of documents: Question User - contains a source field Answer - contains the corresponding question ID and user ID Each questions is answered by multiple users and each user answers each question only once. I want to find for every question how many answers are there answered by users of source "source1". 回答1: I think that the nearer that you can arrive to what you want is the following (using Linked documents). Suppose you have { "_id": "user1", "source": "source1" }, { "_id

Do you clean your map/reduce functions before submission? How?

只愿长相守 提交于 2019-12-13 18:28:34
问题 In couchdb, one can define map and reduce functions in Javascript, and submit them via HTTP POST to the server to define views. Cool. Apps specify a string representation of the respective functions. I am building a JS app that connects to couchdb, using emacs, a text editor. This lets me define map and reduce functions like this: var byname = function(doc) { emit(doc.name,null); }; This gives me emacs syntax highlighting, jslint checks, and so on. At runtime, I can get the string

couchdb erlang reduce - aggregate object

橙三吉。 提交于 2019-12-13 18:12:04
问题 Say I have a map that emits the following objects {"basePoints": 2000, "bonusPoints": 1000} {"basePoints": 1000, "bonusPoints": 50} {"basePoints": 10000, "bonusPoints": 5000} How could I write a reduce in Erlang (not javascript) that would return an aggregate object like this: {"basePoints": 13000, "bonusPoints": 6050} (I would rather not have to write 2 separate views that emits each value separately if I can help it) Many Thanks! 回答1: You actually do not need special reduce, in this case

CouchDB Map/Reduce view query from Ektorp

亡梦爱人 提交于 2019-12-13 18:01:57
问题 I'm trying to execute a query from java against a Map/Reduce view I have created on the CouchDB. My map function looks like the following: function(doc) { if(doc.type == 'SPECIFIC_DOC_TYPE_NAME' && doc.userID){ for(var g in doc.groupList){ emit([doc.userID,doc.groupList[g].name],1); } } } and Reduce function: function (key, values, rereduce) { return sum(values); } The view seems to be working when executed from the Futon interface (without keys specified though). What I'm trying to do is to

Saving JSON object in CouchDB from JavaScript

本小妞迷上赌 提交于 2019-12-13 17:13:15
问题 I am retrieving a form value in JavaScript and converting it to a JSON object using JSON.stringify() . Now I want to save it in CouchDB. Can anyone tell how to do that? 回答1: I think it was: var json = {_id:1 friends:["friend1","friend2"]} couchdb.save(json); var friends = couchdb.open(1).friends; Hope that could help you. 来源: https://stackoverflow.com/questions/10570062/saving-json-object-in-couchdb-from-javascript

Filter and update functions in CouchDB?

微笑、不失礼 提交于 2019-12-13 16:08:18
问题 What are these functions? Where can I read about how they work? The CouchDB definitive guide doesn't explain it, weird. 回答1: From the CouchDB definitive guide: There are other design document functions that are being introduced at the time of this writing, including _update and _filter that we aren’t covering in depth here. Filter functions are covered in Chapter 20, Change Notifications. Imagine a web service that POSTs an XML blob at a URL of your choosing when particular events occur.