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

Documentation outdated in page http://www.couchbase.com/docs/couchbase-devguide-2.0/filter-extract-data.html

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.0
    • 2.0-beta, 2.0-beta-2, 2.0
    • None
    • Security Level: Public
    • None

    Description

      The page at:

      http://www.couchbase.com/docs/couchbase-devguide-2.0/filter-extract-data.html

      Shows several documents with the _id and _rev fields. These meta data fields are no longer inlined in documents after DP4.

      Also, the field "language" for design documents has no special meaning in Couchbase (unlike Apache CouchDB), being superfluous and confusing to users.

      There's also a map function example with duplicated if conditional:

      function(doc) {
      if (doc.title) {
      if(doc.title)

      { emit(doc.title, null); }

      }
      }

      Finally, the following paragraph:

      "As a best practice we want make sure that the fields we want to include in our index actually exist. Therefore we have our map function within a conditional: if (doc.age && doc.name). This ensures the fields exist in documents when we query the view and we therefore avoid a view failure when Couchbase Server generates the index."

      Is not completely correct. If doc.age or doc.name don't exist in a document, using them as keys or values doesn't produce an error.
      Undefined fields in JavaScript are serialized to a JSON null value.
      What would produce an error would be something like referencing doc.name.length, when name isn't defined in the document.

      Attachments

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

        Activity

          People

            kzeller kzeller
            FilipeManana Filipe Manana (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty