public static BsonArray encodeAsStrings(Collection<? extends Enum<?>> collection) {
        List<BsonValue> list = new ArrayList<>(collection.size());
        for (Enum<?> value : collection) {
            list.add(new BsonString(value.name()));
        }
        return BsonArrayUtil.newArray(list);
    }
TODO: unify the logic of {@link #encode} and {@link #write}
turms-server-common/src/main/java/im/turms/server/common/storage/mongo/codec/CodecUtil.java