Archiv der Kategorie ‘CouchDB‘

CouchDB - How to replace an SQL Auto-Value, Auto-Increment or DB-Sequence with CouchDB Views?

Friday, den 30. April 2010

Learning CouchDB for a SQL educated person is sometimes a bit tricky because things are solved so different. So happened to me.
Currently I am trying to create a simple invoicing app based on CouchDB. When creating invoices you might want to have a straight integer sequence to acts as invoice numbers. In a RDBM this […]

CouchDB - Debug CouchDB Views

Friday, den 30. April 2010

In order to debug couchDB view functions you can use the log - function:

function(keys, values, rereduce) {
var max = 0;
for( i in values ) {
log( “\n\n” + values[i] + “\n\n”);
if (values[i] > max) {
max = values[i];
}
}

return max;
}
You’ll find the output in your couchdb-Log file.

CouchDB - Where can I find more information about build in JavaScript functions like sum()?

Friday, den 30. April 2010

When starting to work with CouchDB the lack of an indepth documentation can be a bit frustrating.
If you’re wondering where JavaScript methods like “sum” used in reduce functions are described, for example, you don’t find any detailed information in the CouchDB-Wiki.
What you can do is to have a look at:
COUCHDB_HOME/share/server
There are a number of javascript […]