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

    • Task
    • Status: Closed
    • Critical - P2
    • Resolution: Fixed
    • None
    • 1.9.1
    • 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

        Issue Links

          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: