@Override
    public void encode(BsonWriter writer, Somebody value, EncoderContext encoderContext) {
      writer.writeStartDocument();
      writer.writeObjectId("_id", value.id());
      writer.writeString("prop1", value.prop1());
      writer.writeDateTime("dateChanged", value.date().getTime());
      writer.writeEndDocument();
    }
Manually reads and writes all attributes
mongo/test/org/immutables/mongo/fixture/BsonCodecRepoTest.java