我正在尝试使用参数化的 N1QL 查询,但它无法识别 json 占位符并引发不正确的语法异常。
代码:
public static final String LMR_DETAILS
= "SELECT * FROM $bucketName WHERE lmr.lmrStatusDescriptionTe ='PENDING'and STR_TO_MILLIS(lmr.recordExpirationTs) BETWEEN STR_TO_MILLIS($startTime) AND STR_TO_MILLIS($endTime)";
String bucketName = bucket.bucketManager().info().name();
JsonObject placeHolders = JsonObject.create().put("bucketName", bucketName).put("startTime", reqDates[0]).put("endTime", reqDates[1]);
N1qlQuery query = N1qlQuery.parameterized(QueryString.LMR_DETAILS, placeHolders);
N1qlQueryResult result = bucket.query(query);