bson.UnmarshalExtJSON does not support Infinity/-Infinity values

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Critical - P2
    • None
    • Affects Version/s: 1.8.4
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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. 

            Assignee:
            Matt Dale
            Reporter:
            Cedric Cordenier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: