Search in sources :

Example 1 with MongoDriverInformation

use of com.mongodb.MongoDriverInformation in project mongo-java-driver by mongodb.

the class ClientMetadataHelper method addDriverInformation.

private static BsonDocument addDriverInformation(final MongoDriverInformation mongoDriverInformation, final BsonDocument document) {
    MongoDriverInformation driverInformation = getDriverInformation(mongoDriverInformation);
    BsonDocument driverMetadataDocument = new BsonDocument(DRIVER_NAME_FIELD, listToBsonString(driverInformation.getDriverNames())).append(DRIVER_VERSION_FIELD, listToBsonString(driverInformation.getDriverVersions()));
    document.append(DRIVER_FIELD, driverMetadataDocument);
    document.append(PLATFORM_FIELD, listToBsonString(driverInformation.getDriverPlatforms()));
    return document;
}
Also used : BsonDocument(org.bson.BsonDocument) MongoDriverInformation(com.mongodb.MongoDriverInformation)

Aggregations

MongoDriverInformation (com.mongodb.MongoDriverInformation)1 BsonDocument (org.bson.BsonDocument)1