com.anwen.mongo.aggregate.pipeline.Variable Maven / Gradle / Ivy
package com.anwen.mongo.aggregate.pipeline;
import com.anwen.mongo.support.SFunction;
/**
* $lookup阶段中的新变量,let
* 对{@link com.mongodb.client.model.Variable}进行封装,支持lambda
* @author anwen
* @date 2024/6/11 下午7:33
*/
public class Variable extends com.mongodb.client.model.Variable {
/**
* 创建一个新的变量定义,用于 $lookup 管道阶段
* @param name 新变量的名称
* @param value 新变量的值
* @author anwen
* @date 2024/6/11 下午7:36
* @since mongodb.driver.manual reference/operator/aggregation/lookup/ $lookup
*/
@SuppressWarnings("unchecked")
public Variable(String name, SFunction value) {
super(name, (TExpression) value.getFieldNameLineOption());
}
@SuppressWarnings("unchecked")
public Variable(String name, String value) {
super(name, (TExpression) value);
}
}