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

More detailed information about retrieving binary in views

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Fix
    • Minor
    • techdebt-backlog
    • 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

      Attachments

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

        Activity

          People

            akurtzman Amy Kurtzman (Inactive)
            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

                PagerDuty