Class MongoTypeConverter

java.lang.Object
com.northconcepts.datapipeline.mongodb.MongoTypeConverter

public class MongoTypeConverter extends Object
Converts DataPipeline records and values to and from MongoDB BSON documents and values.
  • Method Summary

    Modifier and Type
    Method
    Description
    static Record
    bsonDocumentToRecord(BsonDocument document)
    Converts a BSON document to a record with one field per key, converting nested documents and arrays recursively.
    static ValueNode<?>
    bsonValueToValueNode(BsonValue bsonValue)
    Converts a BSON value to a value node (null for a BSON null); documents become records and object IDs become strings.
    static BsonDocument
    Converts a record to a BSON document with one entry per field, converting nested records and arrays recursively.
    static BsonValue
    Converts a value node to a BSON value (BSON null for null values); throws for big integers, big decimals and UUIDs.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • bsonDocumentToRecord

      public static Record bsonDocumentToRecord(BsonDocument document)
      Converts a BSON document to a record with one field per key, converting nested documents and arrays recursively.
    • bsonValueToValueNode

      public static ValueNode<?> bsonValueToValueNode(BsonValue bsonValue)
      Converts a BSON value to a value node (null for a BSON null); documents become records and object IDs become strings.
    • recordToBsonDocument

      public static BsonDocument recordToBsonDocument(Record record)
      Converts a record to a BSON document with one entry per field, converting nested records and arrays recursively.
    • valueNodeToBsonValue

      public static BsonValue valueNodeToBsonValue(ValueNode<?> valueNode)
      Converts a value node to a BSON value (BSON null for null values); throws for big integers, big decimals and UUIDs.