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

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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Critical - P2 Critical - P2
    • 1.9.1
    • None
    • Index Maintenance
    • 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

        Activity

          People

            aaron Aaron Staple
            eliot Eliot Horowitz (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: