[N1QL] Querying against non-JSON values

Hello,

When using standards MapReduce Views with couchbase, it is possible to run them agains values that are non JSON but integers (that have been set with incr for example)

This doc values can then be used in the reduce function with _sum or _count

Is there any way to do the same with N1QL ?

Ex:

When we run a ‘select * from bucket’ on a bucket that only contains integer values, we get a resultset full of {} :

‘select * from metrics LIMIT 2’
“resultset”: [
{},
{}
]

It would be really interesting to get the integer value in the resultset, and to be able to use it in some more complex queries.

Xavier


PS :
N1QL is only CB 2.2 compatible, and CB 2.2 CE is still not available
When do you plan to release CB 2.2 CE ?

Hello,

You can do

SELECT VALUE() FROM metrics LIMIT 2

Regarding the question on when 2.2 CE will be released?
We release the EE first, and then subsequently follow up with the CE release.
We are working on the CE and will be releasing it once the release is ready to go - tentatively in a few weeks possibly.

VALUE() is what we have been looking for : Thanks

Hi,

In the upcoming N1QL DP4, you would use:

SELECT metrics FROM metrics LIMIT 2;