Re: simple use cases for couch db

2010-11-17 Thread Nicholas Orr
I've been using it for querying read only data, specifically car data. So I see it as being really useful for storing factual data (catalogs) that doesn't change, because once a 2010 Toyota Camry is released it never becomes a 2009 Jeep Cherokee. The applications I'm involved in use car data for ge

Re: simple use cases for couch db

2010-11-17 Thread David Rose
At SXSW, we started using CouchDB last fall because we needed to create an API for 3rd-party developers to write mobile apps using our event schedule data. So we copied the needed data from a collection of legacy databases into a CouchDB, threw in a few views, and, voila... a fast, well-documented,

Re: simple use cases for couch db

2010-11-17 Thread Keith Gable
On Wed, 2010-11-17 at 22:18 -0600, Andy wrote: Without touching the replication or offline/online stuff as I haven't used it yet... CouchDB is useful any time that you would be using a serialized (aka XML aka JSON aka YAML) column in a relational database. It also works better for mainly read si

simple use cases for couch db

2010-11-17 Thread Andy
So Ive been obsessively reading about and researching CouchDB over the past couple weeks. I even wrote my own Java client since the ones on the market weren't up to my standards :) I've probably read 200 articles on google explaining the downsides to CouchDB. I've read the Use Cases on Couch

GeoCouch weird issue / won't index

2010-11-17 Thread Keith Gable
I'm trying out GeoCouch right now and I'm coming across something I've been banging my head on for an hour or two now. I got the examples to work, but I can't get anything to actually work with my real data. Here is my spatial function (which is design_doc["spatial"]["geocode"] in case I have it i

Re: Write race conditions, working without _rev

2010-11-17 Thread Chad George
I guess I was more wondering if its possible for two calls to the update function to "see" the same revision of the document. Or if it was possible for another call to document API to successfully update a document *while* the update handler is processing? Are you saying that all the processing of

Re: Write race conditions, working without _rev

2010-11-17 Thread Mike Fedyk
On Wed, Nov 17, 2010 at 5:14 PM, Randall Leeds wrote: > On Wed, Nov 17, 2010 at 16:15, Chad George wrote: >> I've been wondering about this for a while, when two update requests for the >> same document come to couchdb nearly simultaneously what exactly happens? >> >> Is it possible for both requ

Re: Write race conditions, working without _rev

2010-11-17 Thread Randall Leeds
On Wed, Nov 17, 2010 at 16:15, Chad George wrote: > I've been wondering about this for a while, when two update requests for the > same document come to couchdb nearly simultaneously what exactly happens? > > Is it possible for both requests to get the same revision of the document to > update or

Re: Write race conditions, working without _rev

2010-11-17 Thread Chad George
I've been wondering about this for a while, when two update requests for the same document come to couchdb nearly simultaneously what exactly happens? Is it possible for both requests to get the same revision of the document to update or is there some mechanism to force the updates to occur in ser

Merge Documents

2010-11-17 Thread Duc Phan
Hello again, Last week I posted a problem about getting documents merged on the same field. Few people made some suggestions and ideas such as combine two documents with same field into one. Well I run into a situation where I can't combine the documents. Scenario: I have documents of two types:

Re: How to keep from sending more than one email from multiple replicated couchdb instances

2010-11-17 Thread Mike Fedyk
On Sun, Nov 14, 2010 at 5:01 PM, Mike Fedyk wrote: > node.js + CouchDB == Crazy Delicious by Mikeal Rogers > http://jsconf.eu/2010/speaker/nodejs_couchdb_crazy_delicious.html > > I was watching this a couple days ago and I've been thinking about how > to deal with instance and service (think of se

Re: Allowing specific field value updates only

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 22:12, Mike Fedyk wrote: > On Wed, Nov 17, 2010 at 4:02 AM, Wordit Ltd wrote: >> On Tue, Nov 16, 2010 at 10:01 PM, Jan Lehnardt wrote: >>> >>> function(newDoc, oldDoc, userCtX) { >>>if(userCtx.roles.indexOf("_admin") == -1) { // not an admin >>> if(newDoc.field > o

Re: Bulk Updates in CouchDB

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 21:53, Neville Franks wrote: > Thursday, November 18, 2010, 7:46:11 AM, you wrote: > > JL> On 17 Nov 2010, at 20:25, Neville Franks wrote: > >>> Hi Jan, >>> Thanks, very useful, however it has a focus on retrieval and doesn't >>> discuss update/delete operations. I've found t

Re: Allowing specific field value updates only

2010-11-17 Thread Mike Fedyk
On Wed, Nov 17, 2010 at 4:02 AM, Wordit Ltd wrote: > On Tue, Nov 16, 2010 at 10:01 PM, Jan Lehnardt wrote: >> >>  function(newDoc, oldDoc, userCtX) { >>    if(userCtx.roles.indexOf("_admin") == -1) { // not an admin >>      if(newDoc.field > oldDoc.field) { // your condition is this >>        thr

Re: Bulk Updates in CouchDB

2010-11-17 Thread Neville Franks
Thursday, November 18, 2010, 7:46:11 AM, you wrote: JL> On 17 Nov 2010, at 20:25, Neville Franks wrote: >> Hi Jan, >> Thanks, very useful, however it has a focus on retrieval and doesn't >> discuss update/delete operations. I've found that to largely be the >> case with CouchDB articles etc. ie.

Re: Bulk Updates in CouchDB

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 20:25, Neville Franks wrote: > Hi Jan, > Thanks, very useful, however it has a focus on retrieval and doesn't > discuss update/delete operations. I've found that to largely be the > case with CouchDB articles etc. ie. They discuss retrieval using views > (map/reduce) and insert

Re: Forcing document reindex

2010-11-17 Thread Ryan Ramage
Thinking about this, you don't have to get all the database. If you have the set of keys you are interested in for all the docs eg [clientName, dateMP1, dateM1] 1. create a design doc '_design/report' 2. create a view that for all types you want, eg 'by_id' and emit(doc._id, doc) 3. create a

Re: Bulk Updates in CouchDB

2010-11-17 Thread Neville Franks
Hi Jan, Thanks, very useful, however it has a focus on retrieval and doesn't discuss update/delete operations. I've found that to largely be the case with CouchDB articles etc. ie. They discuss retrieval using views (map/reduce) and inserts but not update/delete so much and not in terms of the bulk

Re: Write race conditions, working without _rev

2010-11-17 Thread Paul Davis
On Wed, Nov 17, 2010 at 1:49 PM, Jan Lehnardt wrote: > > On 17 Nov 2010, at 19:24, Paul Davis wrote: > >> On Wed, Nov 17, 2010 at 1:02 PM, rpke...@gmail.com wrote: >>> >>> >>> Sent from my HTC on the Now Network from Sprint! >>> >>> - Reply message - >>> From: "Luciano Ramalho" >>> Date:

Re: Write race conditions, working without _rev

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 19:24, Paul Davis wrote: > On Wed, Nov 17, 2010 at 1:02 PM, rpke...@gmail.com wrote: >> >> >> Sent from my HTC on the Now Network from Sprint! >> >> - Reply message - >> From: "Luciano Ramalho" >> Date: Sat, Nov 6, 2010 15:52 >> Subject: Write race conditions, work

Re: Forcing document reindex

2010-11-17 Thread Nicolas Jessus
> What about a list function? I really don't see how that would work, except by getting most of the database to be returned to the list function and doing set manipulation there...

Re: Forcing document reindex

2010-11-17 Thread Nicolas Jessus
> you can only emit a result from the map function if key elements to be used > are in the document currently being indexed. Well, yes, that's the problem I'm trying to get around somehow. > have to use a list or one of the lucene projects to combine views together. > or figure out a way to put a

Re: Forcing document reindex

2010-11-17 Thread Nicholas Orr
On Thu, Nov 18, 2010 at 5:00 AM, Nicolas Jessus wrote: > > Naively, the key should be something like [clientName, dateMP1, dateM1], or > maybe [clientName] and a value of [dateMP1, dateM1]. There can be hundreds > of > thousands of meetings. The problem is to generate the key triplet when > there'

Re: Write race conditions, working without _rev

2010-11-17 Thread Paul Davis
On Wed, Nov 17, 2010 at 1:02 PM, rpke...@gmail.com wrote: > > > Sent from my HTC on the Now Network from Sprint! > > - Reply message - > From: "Luciano Ramalho" > Date: Sat, Nov 6, 2010 15:52 > Subject: Write race conditions, working without _rev > To: > > On Fri, Nov 5, 2010 at 2:03 PM,

Re: Write race conditions, working without _rev

2010-11-17 Thread rpke...@gmail.com
Sent from my HTC on the Now Network from Sprint! - Reply message - From: "Luciano Ramalho" Date: Sat, Nov 6, 2010 15:52 Subject: Write race conditions, working without _rev To: On Fri, Nov 5, 2010 at 2:03 PM, Paul Davis wrote: > In the second case, the second person to write the docu

Re: Forcing document reindex

2010-11-17 Thread Nicolas Jessus
Hello Cliff, > I am not sure if I fully understand your use case (however it does sound > intriguing and unusual). Sorry, I'll try to be clearer. I should have taken a real case to start with, I just didn't want to be necessarily verbose (failed!). Consider 5 types of documents: type: Meeting

Re: Forcing document reindex

2010-11-17 Thread Ryan Ramage
What about a list function? You can access the request to get query parameters (eg id needed for the report?) and then you can iterate through the docs and build up your relationship. I dont know how fast it will be with the number of docs you have, but it will be liner time (order n). http://gu

Re: local test server for couchapps

2010-11-17 Thread Chad George
I've rewritten my couchapp proxy server. Its now a single script and will work standalone or as a couchapp extension module. The rewrite was pretty major but I think its a lot better now that it uses asyncore instead of threaded client/server code. All of the Futon tests pass now, except one that

Re: Forcing document reindex

2010-11-17 Thread Cliff Williams
Nicolas, I am not sure if I fully understand your use case (however it does sound intriguing and unusual). A couple of things stick out in your commentary; "The data is only weakly relational." "DB updates are relatively few" I assume that you are getting data out of your legacy MySQL system

Re: Forcing document reindex

2010-11-17 Thread Nicolas Jessus
All right; no one should like what they're going to read. I have a medium-sized MySQL system, which translates to a Couch with about a million documents of about 20 types. The system would really benefit from a schema-free design. The data is only weakly relational. Couch would fit really well, en

Re: Forcing document reindex

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 15:16, Nicolas Jessus wrote: >> No. But storing the document with no changes will do the trick. Of course, > CouchDB will update the _rev field >> in the process. > > That would probably cause concurrency problems with legitimate updates. Shame. > That would be very useful fun

Re: Forcing document reindex

2010-11-17 Thread Nicolas Jessus
> No. But storing the document with no changes will do the trick. Of course, CouchDB will update the _rev field > in the process. That would probably cause concurrency problems with legitimate updates. Shame. That would be very useful functionality. Thanks for the help, anyway Nic

Re: Forcing document reindex

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 14:34, Nicolas Jessus wrote: >> If you make a change to your view functions (a whitespace change will do) >> and query the view again, it'll be rebuilt. >> >> Please don't abuse your couch too much :) >> >> Cheers >> Jan > > > Hello Jan, > Thank you for the answer. I'd just

Re: Forcing document reindex

2010-11-17 Thread Nicolas Jessus
> If you make a change to your view functions (a whitespace change will do) > and query the view again, it'll be rebuilt. > > Please don't abuse your couch too much :) > > Cheers > Jan Hello Jan, Thank you for the answer. I'd just like to avoid rebuilding entire views, and have the benefit of r

Re: Forcing document reindex

2010-11-17 Thread Jan Lehnardt
Ni Nicolas, On 17 Nov 2010, at 14:00, Nicolas Jessus wrote: > Is there a way to force a document reindex, like is triggered by an update, > without actually doing the update? > > I am trying to do unspeakable things to Couch, but ones that would be very > useful (and inefficient, but that woul

Forcing document reindex

2010-11-17 Thread Nicolas Jessus
Is there a way to force a document reindex, like is triggered by an update, without actually doing the update? I am trying to do unspeakable things to Couch, but ones that would be very useful (and inefficient, but that would be ok). I'll tell if it works :) Thanks, Nic

Re: Allowing specific field value updates only

2010-11-17 Thread Jan Lehnardt
On 17 Nov 2010, at 13:02, Wordit Ltd wrote: > On Tue, Nov 16, 2010 at 10:01 PM, Jan Lehnardt wrote: >> >> function(newDoc, oldDoc, userCtX) { >>if(userCtx.roles.indexOf("_admin") == -1) { // not an admin >> if(newDoc.field > oldDoc.field) { // your condition is this >>throw({f

Re: Allowing specific field value updates only

2010-11-17 Thread Wordit Ltd
On Tue, Nov 16, 2010 at 10:01 PM, Jan Lehnardt wrote: > >  function(newDoc, oldDoc, userCtX) { >    if(userCtx.roles.indexOf("_admin") == -1) { // not an admin >      if(newDoc.field > oldDoc.field) { // your condition is this >        throw({forbidden : message}); > ... Many Thanks. Aha! So this

Re: Bulk Updates in CouchDB

2010-11-17 Thread Jan Lehnardt
Hi Neville, The CouchDB Book has a chapter on solving common tasks in CouchDB if you have an RDBMS background: http://guide.couchdb.org/editions/1/en/cookbook.html It doesn't cover your case, but I intend to add it. Cheers Jan -- On 16 Nov 2010, at 23:02, Neville Franks wrote: > Hi Jan, >

Re: CouchDB Web Server access on a LAN.

2010-11-17 Thread Cliff Williams
Neville, Glad you are up and running. It does not look as if hostname will work. I tried it on my test couchdb instance. using 0.0.0.0 will make it bind to available IP addresses which may, or may not be suitable. best regards cliff PS You can also access the configuration page from the

Re: CouchDB Web Server access on a LAN.

2010-11-17 Thread Neville Franks
Hi Cliff, Thanks for that. Pity I wasn't able to find this for myself. :) I tried adding the PC's Hostname and Erlang wasn't happy. I noticed the Werl window mentioned etc/local.ini so I opened that and changed the Hostname to the IP address and it works as I wanted. Do you know if a Hostname sho

Re: CouchDB Web Server access on a LAN.

2010-11-17 Thread Cliff Williams
Neville, Good Morning. initially go to http://127.0.0.1:5984/_utils/config.html change the bind address (about half way down), restart couchdb, and you should be good to go best regards cliff On 17/11/10 08:02, Neville Franks wrote: I'm trying to access CouchDB on a PC on my LAN using its

CouchDB Web Server access on a LAN.

2010-11-17 Thread Neville Franks
I'm trying to access CouchDB on a PC on my LAN using its IP address ie. 192.168.1.2:5984 and failing. I can access it on the other PC using localhost but using the PC's IP address on the same PC also fails. I can ping the other PC ok. I also tried using the PC's Host Name and that failed. I've tri