我有一个mongoose模型,其中一个字段是日期数组,我需要查询集合来查找该数组中日期在过去7天之间的任何文档,但是当我尝试使用$gt或$gte时,它不会返回文档,即使文档存在(我已经检查了文档是否存在Here it is an example of the object 它不应该返回超过7天的对象。下面是我使用的代码: const { subDays } = require("date-fns");
const mongo
我目前在一个名为Consumer_Complaints的mongoDB数据库中有一个名为consumer_Complaints的集合(很抱歉让人感到困惑)。我可以通过mongo shell访问Consumer_Complaints集合,但无法在我的应用程序中访问它。我现在使用的是express。以下是我的代码(已更新):
//open co