Details
-
Improvement
-
Resolution: Won't Fix
-
Minor
-
2.0
-
None
-
Security Level: Public
-
None
Description
I think in the case of a document that is binary, the "doc" argument to the map function will be a base64 encoded string. So you can call
var arrayOfBytes = decodeBase64(doc);
you can get an approximation of the size of the doc from doc.length, or an exact answer from arrayOfBytes.length
I think you can do:
if (meta.deleted) emit("deleted")
But all of this is closer to conjucture about how I think it should work, mixed with memories of what the code looks like. I'm not if we have advanced docs on this stuff. CC'ing Karen sho can hopefully point to the place in the docs.
Chris
On Thu, Dec 13, 2012 at 5:41 AM, Perry Krug <perry@couchbase.com> wrote:
Hey man,
-We discussed a while ago having access within the view code to the binary doc object even if it wasn't json. Do we have any write up on how to get access to it and what's possible? Let's imagine it's just a string or csv...how would you go about attacking it?
-Is the meta.* that you see in the view screen all that's avialable? Customer was asking for size of the document...maybe you can just calculate that within the javascript on the doc object?
-Anyway to get a view on deleted items (as we're keeping them around for the time being with xdcr)?
Thanks