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

Aggregation pipeline cannot process system.profile doc fields with $ prefixes

    XMLWordPrintableJSON

Details

    • Query Optimization

    Description

      Due to strict FieldPath validation, aggregation pipelines cannot process fields that start with a $ character (commonly found in the system.profile collection).

      Steps to reproduce (copied here so code formatting works):

      db.system.profile.drop();
      db.setProfilingLevel(2);
      db.foo.update({},{$set:{x:1}})
      db.setProfilingLevel(0);
      db.system.profile.aggregate([
        { "$match" : {"op" : "update"}},
        { "$project" : {"set" : "$updateobj.$set"}}
      ]);

      Exception:

        "errmsg" : "exception: FieldPath field names may not start with '$'.",
        "code" : 16410,
        "ok" : 0

      Attachments

        Issue Links

          Activity

            People

              backlog-query-optimization Backlog - Query Optimization
              jmikola@mongodb.com Jeremy Mikola
              Votes:
              3 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated: