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

executing the expression in a field

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      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

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: