let totalProducts = await RentedProducts.find({
customer: req.params.id,
}).project({ barcodes: 1 })
我只想获取条形码字段,但它给出了错误。
类型错误:RentedProducts.find(...).project 不是函数
我还安装了 MongoDB Nodejs 驱动程序:
"mongodb": "^3.6.3",
如何使用 .project() 通过减少返回字段的数量来最小化带宽。
扬帆大鱼
相关分类