Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-7433

More detailed information about retrieving binary in views

    Details

      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

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

        Hide
        kzeller kzeller added a comment -

        From Dipti: temporary workaround for now, lower priority (priority 3)

        Show
        kzeller kzeller added a comment - From Dipti: temporary workaround for now, lower priority (priority 3)
        Hide
        akurtzman Amy Kurtzman added a comment -

        Closing because there isn't a clear request for documentation here and also because it's against the 2.0 version.

        Show
        akurtzman Amy Kurtzman added a comment - Closing because there isn't a clear request for documentation here and also because it's against the 2.0 version.

          People

          • Assignee:
            akurtzman Amy Kurtzman
            Reporter:
            kzeller kzeller
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Gerrit Reviews

              There are no open Gerrit changes