strict parsing of extended JSON $numberInt reads value as string

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.0
    • Affects Version/s: bson-4.0.4
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      > EJSON.parse(`{"$numberInt":"1"}`);
      1
      > EJSON.parse(`{"$numberInt":"1"}`, { relaxed: false });
      Int32 { value: '1' }
      > 
      

      roundtripping this value will result in type loss

            Assignee:
            Thomas Reggi (Inactive)
            Reporter:
            Matt Broadstone
            None
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: