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

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

    • Query Optimization

      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
      

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            4 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated: