我想将数据从集合传递到MongoDB的视图.如何执行查询(限制1)将结果赋给VIEWBACK变量?
例如,我希望在LINQ中传递以下查询
db.getCollection('monitoreo').find({valor:'002'}).limit(1)
我保留了返回整个列表的控制器的示例,并将其传递给视图
public ActionResult Index()
{
List<monitoreoModel> monitoreo = monitoreoCollection.AsQueryable<monitoreoModel>().ToList();
return View(monitoreo);
}
请帮帮忙,谢谢!