wcummings/cberl — pull request #4 by fauxsoup (2014-11-03 19:52:57+00:00)
Title: Updates to key handling (and more)

Updates key support for a few operations: when retrieving or storing values, allows iolists for the key (by virtue of enif_inspect_iolist_as_binary); when querying views, allows arbitrary key types.

The reasoning behind the latter is simple: the key for a view does not have to be a string. I have created some views that emit boolean values as their keys, and encoding these as a string will result in a key-targeted query to return no results.

Similarly, integers and arrays can also be used for keys.

Includes some things from chitika/cberl because that's where I forked from. Specifically, it includes a fix for a bug which caused intermittent connection errors when using the HTTP API with views that was caused by sending a content-body in the HTTP GET request without the content-length parameter (this was actually an error in libcouchbase). The fix simply changes the "body" parameter to an http request from an empty JSON-object to an empty string.