0

myModel.find({},函数(错误,模型){

console.log(models.toJSON()); //错误:对象没有toJSON方法

})

4

1 回答 1

1

您几乎拥有它,但您需要使用 JSON.stringify() 而不是 toJSON():

myModel.find({}, function(err, models){
  console.log(JSON.stringify(models));
})
于 2011-04-27T19:00:24.647 回答