Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
myModel.find({},函数(错误,模型){
console.log(models.toJSON()); //错误:对象没有toJSON方法
})
您几乎拥有它,但您需要使用 JSON.stringify() 而不是 toJSON():
myModel.find({}, function(err, models){ console.log(JSON.stringify(models)); })