How to convert a CAS value retrieved using N1QL into one I can pass to other calls

When I retrieve document info using N1QL, I can get the CAS value using meta().cas, but the value I get is something like cas = 372238758379520. Passing that as a CAS value chokes saying that it either needs to be a CAS object or string.

How do I get a usable CAS value from the value returned by the N1QL query?

I think this is a bug. I can also see the CAS values are not the same. When I query data with bucket.get() the CAS value is string “250688105616660” and when I do same query with N1QL the CAS value is number 1447200156782100500 but what is more important the values are not the same so it seems N1QL query is returning different CAS value than bucket.get() query.