0
I need to know how to get the last record stored in Mongo.
I’m doing a search, comparing two IDS, need only return the last record.
I have the following variables::
client.name
client.cpf
client.endereço
I’m doing the search as follows:
Client.findById({$and: [{_id: client.Client.id}, {_id: contact.id}]}, {sort: {cpf: -1 }}, function(err, clients) {
console.log("client.id: "+client.Client.id)
console.log("post"+post)
console.log("imprimir: "+contact.code)
console.log("nome"+client.cpf)
callback();
});
},
But it doesn’t work.
Okay, good. I’ll delete the comments then...
– Sergio