Uploaded image for project: 'CouchDB'
  1. CouchDB
  2. COUCHDB-573

Regex capture problem in emit functions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Invalid
    • 0.11
    • 0.11
    • None
    • None
    • Linux

    Description

      The capture variables $0, $1, $2... don't get instantiated in regex expressions placed in emit functions.

      Example:
      function(doc) { if (doc.EntityType != null) { emit(doc.ID.Value + '.' + doc.EntityType, { Type: doc.EntityType.replace(/[A-Z]/g, ' $0'), ....

      EntityType: TestTwo
      Returns:
      Type: " $0est $0wo"

      Instead of:
      Type: " Test Two"

      Attachments

        Activity

          People

            Unassigned Unassigned
            ericdes Eric Desgranges
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: