Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13323

Investigate changes in SERVER-40687: Positional projection ($) only considers first path component when comparing to query document

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.3
    • Component/s: manual
    • Labels:
    • Last comment by Customer:
      true
    • Sprint:
      ServerDocs2020: Jun 1 -Jun5, ServerDocs2020: Jun8-Jun12, ServerDocs2020: Jun16-Jun19, ServerDocs2020: Jun22-Jun26

      Description

      Description

      Downstream Change Summary

      In 4.3 users will be allowed to apply the positional projection to fields that are not part of the query document.

      For example db.c.find(

      Unknown macro: {a}

      ,

      Unknown macro: {b.$}

      ).

      This was illegal in 4.2 (the positional projection had to be on a field used in the filter).

      This brings the behavior of positional projection and positional update closer together.

      Description of Linked Ticket

      Using a non-matching subfield (e.g., query: fieldExists.something: 1 projection: fieldExists.fieldDoesntExist.$) with the $ projection operator does not return the Positional projection 'fieldExists.fieldDoesntExist.$' does not match the query document error.
       
      Given the document:

      {
      	"_id" : ObjectId("5cb8ab2f20926051ca9e2cd7"),
      	"AOE" : [
      		{
      			"areaOfExpertise" : "aoe1",
      			"subAOE" : []
      		},
      		{
      			"areaOfExpertise" : "aoe2",
      			"subAOE" : []
      		}
      	],
      	"poolName" : "newpool",
      	"__v" : 0
      }
      

      The {"AOE.doesntExist.$":1} projection is treated the same as the correct {"AOE.$":1} projection:

      > db.proj.find({ poolName: "newpool", "AOE.areaOfExpertise": "aoe1" },{"AOE.doesntExist.$":1}).pretty()
      {
      	"_id" : ObjectId("5cb8ab2f20926051ca9e2cd7"),
      	"AOE" : [
      		{
      			"areaOfExpertise" : "aoe1",
      			"subAOE" : []
      		}
      	]
      }
      > db.proj.find({ poolName: "newpool", "AOE.areaOfExpertise": "aoe1" },{"AOE.$":1}).pretty()
      {
      	"_id" : ObjectId("5cb8ab2f20926051ca9e2cd7"),
      	"AOE" : [
      		{
      			"areaOfExpertise" : "aoe1",
      			"subAOE" : []
      		}
      	]
      }
      

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jeffrey.allen Jeffrey Allen
              Reporter:
              backlog-server-pm Backlog - Core Eng Program Management Team
              Participants:
              Last commenter:
              Jeffrey Allen Jeffrey Allen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                1 year, 30 weeks, 1 day ago
                Date of 1st Reply: