我在數據庫中有 20 多個產品,我正在嘗試顯示所有產品,所以我使用了 Product.find({}).toArray(function(err,data){ if(err){ res.send(err) } if(data){ res.send(data) } }但我收到一個錯誤TypeError: Product.find(...).toArray is not a function所以我用Product.find({},function(err,products){ if(err){ res.send(err) } if(products){ res.send(products) }})但它只打印出 20 個產品。所以我試過了Product.find({},function(err,products){ if(err){ res.send(err) } if(products){ res.send(products) }}).limit(300)但它仍然打印出 20 個產品
.toArray 不工作
翻閱古今
2021-06-29 13:44:22