I’m getting an error on one part of the :clouchdb example code (that’s a link, but the examples.lisp file included doesn’t work properly either).
Specifically, when I input
> (create-document '((:|name| . "wine") (:|tags| . ("beverage" "fun" "alcoholic"))))
I get a DOC-ERROR condition
Reason "Content-Type must be application/json", Document ID: "NIL"
[Condition of type DOC-ERROR]
Restarts:
0: [RETRY] Retry SLIME REPL evaluation request.
1: [*ABORT] Return to SLIME's top level.
2: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" RUNNING {10040D2E11}>)
Backtrace:
0: (POST-DOCUMENT ((:|name| . "wine") (:|tags| "beverage" "fun" "alcoholic")))
1: (SB-INT:SIMPLE-EVAL-IN-LEXENV (CREATE-DOCUMENT '((:|name| . "wine") (:|tags| "beverage" "fun" "alcoholic"))) #<NULL-LEXENV>)
--more--
The intended effect of the example is to have CouchDB assign an ID to the new document (this is made clear both in the linked page and in the comments of the code file).
I’m running SBCL 1.0.40.0, clouchdb_0.0.11 (straight out of quicklisp) and CouchDB 0.11 from the Debian repos, in case it matters. I’m also on a 64-bit Debian box.
Can anyone point me in the right direction?
CouchDB requires a “Content-Type: application/json” when POST’ing documents, this is a fairly new requirement so I think clouchdb simply isn’t doing it yet.
Shorter version: Sounds like clouchdb is not compatible with recent releases of CouchDB.