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

Longs that fit into a JS Number is represented as a JS Number

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 0.15.0
    • Affects Version/s: None
    • Component/s: Shell API
    • Labels:
      None
    • Needed
    • Iteration Düsseldorf

      Enterprise replset [direct: primary]> db.test.insertOne({ value: Long(10) })
      {
        acknowledged: true,
        insertedId: ObjectId("60b795a40a328707b213782a")
      }
      Enterprise replset [direct: primary]> db.test.find()
      [ { _id: ObjectId("60b795a40a328707b213782a"), value: 10 } ]
      

      The value is stored properly on the server, but because the driver defaults the promoteLongs option to true. The legacy shell returns NumberLong(10) instead.

            Assignee:
            anna.henningsen@mongodb.com Anna Henningsen
            Reporter:
            anna.henningsen@mongodb.com Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: