Javascript version for view definition functions in Couchbase 4.1


#1

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.


#2

we are using v8 version 3.21. We are looking to upgrade to the latest stable with the upcoming version. would you be interested in an early preview?
thanks
-cihan


#3

Thanks for replying Cihan.

Yes, we are interested and can try out the preview version and provide feedback. Let me know where we can get it.


#4

great. pls expect an update around late Jan, early feb. in 2016.