couchdb

including documents in the emit vs include_docs = true for couchdb

i ran across a mention somewhere that doing an emit(key, doc) will increase the amount of time an index takes to build (or something to that effect). is there any merrit to it, and is there any reason not to just always do emit(key, null) and then include_docs = true? ...

CouchDB view question

What am I missing here? When I access /mydatabase/_design/assets/_view/all (CouchDB) I'm getting: "{"error":"EXIT","reason":"{function_clause,\n [{couch_httpd,handle_db_request,\n [{mochiweb_request, ..." This is my view document: {"_id":"_design\/assets","_rev":"4243492989","language":"javascript","views":{"all":{"map":"...

CouchDB multiple tags

Is there any way to have multiple tag search implemented in CouchDB? I have documents (posts) each with multiple tags. I need to find posts that have been tagged with an arbitrary set of tags. How do I do it? I could of course do it with multiple calls to a view which gives me the documents for a tag and then sort it out in my app but I ...

Multiple developers keeping CouchDB in sync with eachother

I'm considering using CouchDB for an upcoming web development project. What is the best way to keep the CouchDB document repo in sync between various developers who are all running the application locally? An Example: Suppose Developer A creates a new view or design document in Couch or just simply adds a field to an existing view. Th...

Which is the most suitable Key-Value Store for a RDBMS background person?

Is there a distinct winner among all the key-value stores? Cassandra, MongoDB, CouchDB? and do they all follow some central guidelines? or they all have their own say in defining their APIs. I'm asking this question, especially from a perspective of a RDBMS skilled person who is new to key-value stores. Which one should we follow to bes...

Javascript library for exporting XML

Hi, I'm currently using couchdb to store documents as JSON. One of my clients needs to grab XML (for now). Anyone know any good javascript libraries that can take a javascript object (or json string) and export valid xml? Thanks! ...

Anatomy of a Distributed System in PHP

I've a problem which is giving me some hard time trying to figure it out the ideal solution and, to better explain it, I'm going to expose my scenario here. I've a server that will receive orders from several clients. Each client will submit a set of recurring tasks that should be executed at some specified intervals, eg.: cl...

Principles for Modeling CouchDB Documents

I have a question that I've been trying to answer for some time now but can't figure out: How do you design, or divide up, CouchDB documents? Take a Blog Post for example. The semi "relational" way to do it would be to create a few objects: Post User Comment Tag Snippet This makes a great deal of sense. But I am trying to use cou...

Unique constraints in couchdb

Are there any techniques/proposals to enforce unique constraints? Yes, we can create key that's unique, but we cannot change key and keys and also this approach is not suitable for complicated validation (separate unique login, separate unique email, etc...) For example, an Account should have unique login and email. Deriving a key from...

What is couchdb, for what and how should I use it?

I hear a lot about couchdb, but after reading some documents about it, I still don't get why to use it and how. Could you clarify this mystery for me? ...

Visual Studio - Edit source code located in a database

I am building something similar to Server Explorer for Apache CouchDB. One of the things necessary is to be able to edit CouchDB view definitions which in CouchDB are JavaScript functions. How can I trick Visual Studio into using my object to retrieve and save the content of the JavaScript function but still use the rest of it - I am h...

What is the CouchDB equivalent of the SQL COUNT(*) aggregate function?

Yep, I'm a SQL jockey (sorta) coming into the CouchDb Map/Reduce world. I thought I had figured out how the equivalent of the COUNT(*) SQL aggregator function for CouchDB datasets with the following: Map: function(doc) { emit(doc.name, doc); } Reduce: function(keys, values, rereduce){ return values.length; } Which I thought w...

What are the use cases for non relational datastores?

I'm looking at using CouchDB for one project and the GAE app engine datastore in the other. For relational stuff I tend to use postgres, although I much prefer an ORM. Anyway, what use cases suit non relational datastores best? ...

Which Python client library should I use for CouchdB?

I'm starting to experiment with CouchDB because it looks like the perfect solution for certain problems we have. Given that all work will be on a brand new project with no legacy dependencies, which client library would you suggest that I use, and why? This would be easier if there was any overlap on the OSes we use. FreeBSD only has ...

Meaning of forEach(function(tag) in JavaScript

Hello, I came across the following code fragment in a CouchDB book. function(doc) { doc.tags && doc.tags.forEach(function(tag) { emit(tag, 1); }); } Can some one explain how does the function(tag) part works? Thanks and regards, raj ...

Understanding Key-Value stores

I'm trying to wrap my head around Key-Value stores like CouchDB and Cassandra. I understand why they're useful but as far as how they replace a RDBMS like MySql, I don't get it. Let's say this is my what I need to store: {123456: {'model' : 'Ford' 'color': 'blue' 'MPG': 23}} Then I need to find all the cars that a...

Which key:value store to use with Python?

So I'm looking at various key:value (where value is either strictly a single value or possibly an object) stores for use with Python, and have found a few promising ones. I have no specific requirement as of yet because I am in the evaluation phase. I'm looking for what's good, what's bad, what are the corner cases these things handle we...

Multiple CouchDB Document fetch with couchdb-python

How to fetch multiple documents from CouchDB, in particular with couchdb-python? ...

How do you use CouchDB Change Notifications Continuous Changes from Java?

I am trying to use the couchdb (continuous) changes API from Java and find that after exhausting the list of current changes the stream seems to be closed, not stay open forever as it is supposed to. The code I am using is below. I would expect to never drop out of the while loop, but do as soon as the currently existing changes are fi...

What is the idiomatic way to implement foreign keys in CouchDB?

Let me state a simple example: You have an Order and a Shopping Cart. One way I envision persisting this is to save an Order document and a Cart document. The Order document could have a field called "shopping-cart" whose value is the UUID of the relevant Cart document. Another way I can imagine doing this is to save an Order document wi...