用cts.fieldValueMatch对dateTime数据类型进行通配符搜索。

问题描述 投票:1回答:1

我已经使用FieldValueMatch来做通配符搜索,为 dateTime 数据类型,但当我使用与字符串相同的模式时,它抛出了一个错误。

cts.fieldValueMatch("submittedOn", "2020*", ["case-insensitive"], cts.collectionQuery("customers"))

我是不是用错了图案?谁能给点建议?

javascript marklogic
1个回答
1
投票

这是你得到的错误吗?

[javascript] XDMP-ARG: cts.fieldValueMatch("submittedOn", "2020*", "case-insensitive", cts.collectionQuery("customers")) -- arg2无效。

你的查询方式是 string pattern.$pattern 要匹配的模式。

$pattern 要匹配的模式。参数类型必须与词库类型相匹配。字符串参数可以包含通配符。

为了能够执行通配符的 string 值匹配,你需要有一个 string 范围场指数在该 submittedOn 字段。你可以在同一个字段上有多个索引。

© www.soinside.com 2019 - 2024. All rights reserved.