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

executing the expression in a field

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: 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 } } ])

      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.

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

              Created:
              Updated:
              Resolved: