Details
-
Bug
-
Resolution: Fixed
-
Critical
-
2.1.0, 2.2.0
-
Security Level: Public
-
None
-
MacOSX 64-bit
Description
Start couchbase with 64 buckets (either an OSX build or set the env. variable COUCHBASE_NUM_VBUCKETS=64)
Load the beer-sample data set, create a view:
map: function (doc, meta) {
if (doc.type == "beer" && doc.brewery_id && typeof doc.abv == "number")
}
reduce: _stats
With "Development Time Subset" selected, click "Show results".
Returns the error:
{error,<<"Builtin _stats function requires map values to be numbers">>}if I log the input to builtin_stats from there i see:
[
{<<"[\"alaskan_brewing\",\"alaskan_brewing-alaskan_summer_ale\"]">>, <<"5.3">>},
,
,
,
,
]
When the KV list is being passed to the builtin_stats function in this case, these numbers are still strings (but they were definitely emitted as numbers), causing the when(is_number, First) guard in the second clause to fail.