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

figure out what to do with sorting by array sub-field

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9.1
    • Component/s: Indexing
    • Labels:
      None

      Description

      the ensureIndex changes the output, which is bad.
      not sure what should be correct, but having an index shouldn't change output.

      db.foo.drop()
      db.foo.save( { a : [

      { x : 2 }

      ] } )
      db.foo.save( { a : [

      { x : 1 }

      ] } )
      db.foo.save( { a : [

      { x : 3 }

      ] } )
      db.foo.ensureIndex(

      { "a.x" : 1 }

      )
      db.foo.find().sort(

      { "a.x" : 1 }

      ).forEach( printjson );

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: