【发布时间】:2019-10-28 16:20:50
【问题描述】:
我使用 springboot 和响应式 couchbase 创建了一个 Web 服务,在存储库接口中,我想向 WHERE 子句添加两个字段。我所做的如下
@ViewIndexed(designDoc = "enrolment")
@N1qlPrimaryIndexed
public interface EnrolmentRepository extends ReactiveCouchbaseRepository<Enrolment,String> {
@Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and course like $1 and role like $2 within #{#n1ql.bucket}")
Mono<Enrolment> findEnrolmentByCourseRole(String course, String role);
}
但是当使用上面的代码时,我得到的响应是,
{
"timestamp": "2019-06-14T03:57:29.670+0000",
"path": "/enrolments",
"status": 500,
"error": "Internal Server Error",
"message": "Unable to execute n1ql query due to error:{"msg":"syntax error - at role","code":3000}"
}
我的终点是,
http://localhost:8783/enrolments?course=testcourse&role=testrole
【问题讨论】:
标签: spring-boot reactive-programming spring-webflux n1ql