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

NumberInt object wrapper is not displayed

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: None
    • Component/s: Embedded Shell
    • Labels:
      None
    • Not Needed

      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.

            Assignee:
            backlog-shell-v2 [DO NOT USE] Backlog - Shell Team
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            5 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: