2
I’m generating a Json.
But I have the following situation:
I have a record of contacts who may belong to the same company. I mean, I can have two people registered in a single company.
How do I load these contacts into my json?
I’m doing it this way:
Contato.findById(contato.Cliente.id,function(err, contatos) {
//aqui carrego as informacoes.
But only press the last contact registered, and I need to bring all.
The ID on Mongodb is unique, so because Id can’t find more than one, just try using Contact.find with any information you have..
– João Marcelo Brito