Previously in CouchDB 0.11 calling a list function with query strings passed the query strings as properties of the req.query object with the property name being the query string parameter name and the value being a string containing the query string parameter value.

For example:

?include_docs=true&startkey={"foo":"bar"}&filter={"before":"2010-07-14T"}

would give:

req.query =
{
    include_docs: 'true',
    startkey: '{"foo":"bar"}',
    filter:   '{"before":"2010-07-14T"}'
}

while:

?include_docs=true&startkey=["foo","bar"]&filter={"before":"2010-07-14T"}

would give:


req.query =
{
    include_docs: 'true',
    startkey: '["foo", "bar"]',
    filter:   '{"before":"2010-07-14T"}'
}

Now in CouchDB 1.0.0 the I get the JSON.parse'd values of the startkey, endkey, and key.

For example

?include_docs=true&startkey={"foo":"bar"}&filter={"after":"2010-07-14T"}

gives

req.query =
{
    include_docs: 'true',
    startkey: {"foo":"bar"},
    filter:   '{"after":"2010-07-14T"}'
}

while

?include_docs=true&startkey=["foo","bar"]&filter={"after":"2010-07-14T"}

gives

req.query =
{
    include_docs: 'true',
    startkey: ["foo", "bar"],
    filter:   '{"after":"2010-07-14T"}'
}

I couldn't find any documentation about the change. Is this intended and will it continue to be the case going forward?

bc

Reply via email to