Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-38124

executing the expression in a field

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Aggregation Framework
    • None
    • Query
    • ALL
    • Hide

      db.submissions.aggregate([
          { $addFields: { 
                "ftpath": {
                    $let: {
                       vars: {
                          "identifier": \{$ifNull: ["$requests.Certification.identifiers.Certification.id", ""]},
       },
                        in: \{$concat: [{ $literal: "$outputs." }, "$$identifier", ".response.value.FileType"]}
       }
       },
       "ftval": // I want to evaluate 'ftpath' which has "$outputs.123456.response.value.FileType" init. assign the value to ftval
       } 
       }
      ])
      

      Show
      db.submissions.aggregate([     { $addFields: {           "ftpath": {               $let: {                  vars: {                     "identifier": \{$ifNull: ["$requests.Certification.identifiers.Certification.id", ""]}, },                   in: \{$concat: [{ $literal: "$outputs." }, "$$identifier", ".response.value.FileType"]} } }, "ftval": // I want to evaluate 'ftpath' which has "$outputs.123456.response.value.FileType" init. assign the value to ftval } } ])

    Description

      I want to use a field which has expression within it.

      like ftpath = "$outputs.123456.response.value.FileType"

      I want execute the value inside $ftpath.

      Attachments

        Activity

          People

            backlog-server-query Backlog - Query Team (Inactive)
            nburuzul naresh buruzula
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: