allow returning just the final key when using dot notation

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When querying with dot notation mongodb returns the full path of the object.
      Most of the times the desired behavior is to get only the final key.
      This feature can be configured with 'shortPath: true' or 'lastKey: true'.

      Let's consider the following doc:
      db.session.save({"userid":"5", "key1": {"key2": "val2"}});

      and a dot notation query:
      db.session.find(

      {"userid":"5"}

      ,

      {"key1.key2":1}

      );

      result:
      [{
      "_id" : ObjectId("4bb72974f9054d050a00489f"),
      "key1" :

      { "key2" : "val2" }

      }]

      I suggest that the result will be:
      [{
      "_id" : ObjectId("4bb72974f9054d050a00489f"),
      "key2" : "val2"
      }]

      Thanks

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            pablo platt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: