如何通过一个字段的多个值获取数据?例如,我有包含帖子的数据库,我想查询blogId为1或2的所有帖子,按时间戳排序. collection("posts").whereEqualTo("blogId", "1").whereEqualTo("blogId", 2).orderBy("timest
collection("posts").whereEqualTo("blogId", "1") .whereEqualTo("blogId", 2).orderBy("timestamp", Query.Direction.DESCENDING).limit(50)
上面的代码不起作用:(
怎么做到这一点?
问候 :)
WHERE blogId > 0 AND blogId < 3
试试这段代码:
collection("posts") .where("blogId", ">", "0") .where("blogId", "<", "3") .orderBy("timestamp", Query.Direction.DESCENDING) .limit(50)