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

positional operator projection does not work with find and modify

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Quint Iteration 3.1.2, Quint Iteration 3

      Description

      The match details aren't passed in when find and modify calls transform() so positional operator projection doesn't work yet.

      c = db.c;
      c.drop();
       
      c.save( { a:[ 1, 2 ] } );
       
      // Does the expected projection.
      printjson( c.find( { a:2 }, { 'a.$':1 } ).toArray() );
       
      // Doesn't do the expected projection.
      printjson( c.findAndModify( { query:{ a:2 }, fields:{ 'a.$':1 }, remove:true } ) );
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: