I having problems using couchbase map functions with boolean key.
I wrote a map function with a boolean parameter, but when I try to use this function passing the value "false" as key the function returns nothing
Sample Document:
{
"name": "lorem ipsum",
"presentationId": "presentation_24e53b3a-db43-4d98-8499-3e8f3628a9c6",
"fullPrice": 8,
"isSold": false,
"buyerId": null,
"type": "ticket",
}
Map Function:
function(doc, meta) {
if (doc.type == "ticket" && doc.isSold && doc.presentationId) {
emit([doc.isSold, doc.presentationId], null);
}
}
http://localhost:8092/default/_design/tickets/_view/by_presentation_and_isSold?key=[false,"presentation_24e53b3a-db43-4d98-8499-3e8f3628a9c6"]
Result:
{"total_rows":10,"rows":[]}]}