We just started evaluating Couchbase for one of our projects. One of the things we are trying to achieve with it is be able to define a view per entity type within our product. For example, a “user” view which corresponds to all documents that have “user” information.
To do that we are using the mapper function in the view definition to look something like this:
function (doc, meta) {
if (meta.id.startsWith('user:')) {
emit([doc.id],[doc.id,meta.id]);
}
}
Turns out the “startsWith” isn’t working and the view isn’t evaluating to what we want it to. The startsWith is part of the standard https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith but I guess that’s not yet supported in the version of Javascript supported for these functions.
So is there a place where I can take a look at what version of Javascript is supported for a particular version of Couchbase server? We are using the latest 4.1 server.