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

NumberInt object wrapper is not displayed

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • None
    • No version
    • Shell
    • None
    • Not Needed

    Description

      From the shell, if I execute the following:

      db.aggtype.drop();
      db.aggtype.insert({key: NumberInt(24), value: 7});
      db.aggtype.insert({key: NumberLong(24), value: 8});
      db.aggtype.insert({key: 24, value: 5});
      

      and then display the results with a find(), the first document loses its type wrapper:

      > db.aggtype.find();
      { "_id" : ObjectId("4f569b9a48b5a0bc7ec5828c"), "key" : 24, "value" : 7 }
      { "_id" : ObjectId("4f569b9a48b5a0bc7ec5828d"), "key" : NumberLong(24), "value"
      : 8 }
      { "_id" : ObjectId("4f569b9a48b5a0bc7ec5828e"), "key" : 24, "value" : 5 }
      

      This is deceptive. I know from SERVER-5209 that it is stored as an int, but it looks like a JavaScript double precision float, like the last one.

      Attachments

        Issue Links

          Activity

            People

              backlog-shell-v2 Backlog - Shell Team
              dan@mongodb.com Daniel Pasette
              Votes:
              5 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: