Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mongodb日期参数默认值的Pentaho报告_Mongodb_Pentaho - Fatal编程技术网

Mongodb日期参数默认值的Pentaho报告

Mongodb日期参数默认值的Pentaho报告,mongodb,pentaho,Mongodb,Pentaho,查询是: {{"$match": todaysdate : {$gte: {$date:"${datevalue}"}}, {_id:"field1"}} 其中,参数datevalue的类型为string 我们可以用函数公式来表示吗 =TEXT(DATEVALUE(TODAY()); "YYYY-MM-ddTHH:mm:ssZ") 需要为参数datevalue指定默认值。或者还有其他方法吗?为了保证传递到MongoDB数据源的值是有效的,我将创建一个公式表达式或隐藏参数,并使用后处理公式计算

查询是:

{{"$match": todaysdate : {$gte: {$date:"${datevalue}"}},
{_id:"field1"}}
其中,参数datevalue的类型为string

我们可以用函数公式来表示吗

=TEXT(DATEVALUE(TODAY()); "YYYY-MM-ddTHH:mm:ssZ")

需要为参数datevalue指定默认值。或者还有其他方法吗?

为了保证传递到MongoDB数据源的值是有效的,我将创建一个公式表达式或隐藏参数,并使用后处理公式计算派生值,即:

如果datevalue不为空:datevalue 如果datevalue为空:今天格式为时间字符串。 公式是:

=IF(ISEMPTY([datevalue]); MESSAGE("{0,date,yyyy-MM-dd'T'HH:mm:ssZ}"; TODAY()); [datevalue])