protected Object convert(Path<?> property, Constant<?> constant) {
        if (isReference(property)) {
            return asReference(constant.getConstant());
        } else if (isId(property)) {
            if (isReference(property.getMetadata().getParent())) {
                return asReferenceKey(property.getMetadata().getParent().getType(), constant.getConstant());
            } else if (constant.getType().equals(String.class) && isImplicitObjectIdConversion()) {
                String id = (String) constant.getConstant();
                return ObjectId.isValid(id) ? new ObjectId(id) : id;
            }
        }
        return visit(constant, null);
    }
Serializes the given Querydsl query to a DBObject query for MongoDB

@author laimw
@author sangyong choi
querydsl-mongodb/src/main/java/com/querydsl/mongodb/MongodbSerializer.java