Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-2326

bson.UnmarshalExtJSON does not support Infinity/-Infinity values

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Gone away
    • Icon: Critical - P2 Critical - P2
    • None
    • 1.8.4
    • BSON
    • None

    Description

      Summary

      The bson.UnmarshalExtJSON function and its variants does not support ** the literals Infinity/-Infinity. While these values are not supported by the JSON spec, they can currently be stored in mongo documents.

      How to Reproduce

      https://play.golang.com/p/WNfYw7T_Si8

      Additional Background

      This has created problems for us when attempting to ingest mongo changestreams, since the messages emitted by our DB cannot be unmarshaled using bson.UnmarshalExtJSON.

      To address this, I propose extending the JSON scanner to support Infinity and -Infinity as tokens. 

      Attachments

        Activity

          People

            matt.dale@mongodb.com Matt Dale
            cedric.cordenier@coinbase.com Cedric Cordenier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: