Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1037

Numeric field are sorted to the front (js shell)

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • No version
    • None
    • Embedded Shell
    • None
    • Not Needed

    Description

      In javascript in the shell fields are being reorder, with numeric ones first:

      > x = {a:1, 10:1}
      {"10":1, "a":1}
      

      This becomes a problem when I create a compound index with a numeric attribute name like 10 since the index is not created as expected.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sherry.ger@10gen.com Sherry Ger
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: