public static UpdateDescription fromBsonDocument ( final BsonDocument document ) { keyPresent ( Fields . UPDATED_FIELDS_FIELD , document ) ; keyPresent ( Fields . REMOVED_FIELDS_FIELD , document ) ; final BsonArray removedFieldsArr = document . getArray ( Fields . REMOVED_FIELDS_FIELD ) ; final Set < String > removedFields = new HashSet <> ( removedFieldsArr . size ( ) ) ; for ( final BsonValue field : removedFieldsArr ) { removedFields . add ( field . asString ( ) . getValue ( ) ) ; } return new UpdateDescription ( document . getDocument ( Fields . UPDATED_FIELDS_FIELD ) , removedFields ) ; }
Converts an update description BSON document from a MongoDB Change Event into an UpdateDescription object .