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

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

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • 1.9.1
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • None

      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 );

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

              Created:
              Updated:
              Resolved: