Add parse factory method to BsonArray

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Done
    • Priority: Minor - P4
    • 3.4.0-rc1, 3.4.0
    • Affects Version/s: None
    • Component/s: JSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It would be handy if JSON parsing facilities in the Java driver existed that used compatible types with the collection/database methods that take BSON parameters.

      Notably, parsing a JSON string to pass to the "aggregate" method requires some fiddling to bring the two APIs into alignment. This same condition arises in a few other places wherever something other than BsonDocument is required.

      To go from a JSON string to something which can be passed to the aggregate method, for example, requires this rather unwieldy extra step:

      BsonArray array = new BsonArrayCodec(MongoClient.getDefaultCodecRegistry())
              .decode(new JsonReader(myJsonString), DecoderContext.builder().build());
      

      This ticket is to request the implementation of some intuitive utility methods to bridge the gap. Perhaps directly in the JSON class.

              Assignee:
              Jeffrey Yemin
              Reporter:
              Andrew Ryder (Inactive)
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: