Pergunta

myModel.find({}, function(err, models){

console.log(models.toJSON()); //Error: object has no toJSON method

})

Foi útil?

Solução

You almost have it, but you need to use JSON.stringify() instead of toJSON():

myModel.find({}, function(err, models){
  console.log(JSON.stringify(models));
})
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top