我有一个场景,我需要从学生文档中获取所有记录:
"fname": "abc",
"timeOfAdmission": 1576042885166,
"lname": "rawat",
"studentId": "1"其中studentId是我们的documnetId。
是否可以使用N1ql执行这样的查询
select * from students where (CurrentTime - timeOfAdmission) > 3600000.其中CurentTime、timeOfAdmission和3600000以毫秒为单位。
我们如何使用N1ql编写这个查询?
发布于 2019-12-11 21:09:11
SELECT s.*
FROM students AS s
WHERE s.timeOfAdmission < NOW_MILLIS() - 3600000;
CREATE INDEX ix1 ON students(timeOfAdmission);https://stackoverflow.com/questions/59286432
复制相似问题