couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bradford Winfrey <bradswinf...@yahoo.com>
Subject Re: 412 on update
Date Tue, 21 Oct 2008 13:23:12 GMT
I believe a 412 is a conflict,  anyone care to prove me wrong?



----- Original Message ----
From: Jonathan Moss <jonathan.moss@tangentlabs.co.uk>
To: couchdb-user@incubator.apache.org
Sent: Tuesday, October 21, 2008 3:07:43 AM
Subject: Re: 412 on update

> Hi everyone,
>
> I am using the CouchDB PHP library (from 
> http://couchprojects.googlecode.com/svn/trunk/libraries/php/) to 
> communicate with the database an I am having some issues updating a 
> design document. When I try to save the design document I receive a 
> 412 HTTP status code. The code below is a simplification of what I am 
> doing but should explain what I am trying to do.
>
> $objCouch = new Couch(array("host" => localhost, "port" => 5984));
> $objDesignDoc = $objCouch->database($strDB)->get("_design/ADesignDoc";
> $objFunction = new stdClass();
> $objFunction->map = "function(doc){if(doc.Type = 
> 'ANode'){emit(doc.Name, doc);}}";
> $objDesignDoc->views->$strFunc = $objFunction;
> $objDesignDoc->save();
> echo "Status: " . $objDesignDoc->lastStatusCode . "\n";
>
> What does a 412 status code mean in this context and does anyone have 
> any idea what I can do to fix it?
>
> Regards,
> Jon

I should have mentioned I am using version 0.8.1 of CouchDB

Thanks,
Jon


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message