两天之间无时间的Couchbase N1QL查询数据 [英] Couchbase N1QL query data between two days without time
问题描述
我想在两天之间(从开始日期时间00:00:00.000到结束日期时间23:59:59.999到N1QL从Couchbase存储桶中检索数据
I want to retrieve data from a Couchbase bucket with N1QL between two days (from 00:00:00.000 start date time until 23:59:59.999 end date time)
足以提供没有时间的日期,就像这样:
Is it enough to provide the dates without time, like this:
SELECT c.*
FROM customer c
WHERE c.start BETWEEN '2017-10-09' AND '2017-10-10'
还是我需要明确提供时间:
Or do I need to provide the time explicitly:
SELECT c.*
FROM customer c
WHERE c.start BETWEEN '2017-10-09T00:00:00.000Z' AND '2017-10-10T23:59:59.999Z')
?
推荐答案
ISO-8601中的Couchbase日期与字符串可比.这两个查询都很好.结帐更多详细信息 https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/datefun.html
Couchbase date in ISO-8601 are string comparable. The both queries are fine. Checkout more details https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/datefun.html
这篇关于两天之间无时间的Couchbase N1QL查询数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!