Q:

Node Mongo - can't find document

I'm having trouble to find a document. I have a collection "registosORS" with this structure:
  {
    "_id" : ObjectId("5a1959d75e0b410558e515be"),
    "sessao" : "1",
    "proprioResponsavel" : "on",
    "outroResponsavel" : "",
    "relacao" : "",
    "valorIndividualmente" : "1",
    "valorInterpessoal" : "1",
    "valorSocialmente" : "1",
    "valorGlobalmente" : "1",
    "cliente_id" : "5a1407c8099ca208e48170a5",
    "email" : "mgoncalves@psi.uminho.pt",
    "data" : 1511610839374
}

And I want to find a document by the cliente_id value. 
Everything works fine but when I get into the "registosORS" collection query, the result is null.
ClientesDAO.prototype.insereDadosOrs = function(dadosORS, date, callback){
    this._connection.open(function(err,mongoClient){
        mongoClient.collection('clientes', function(err,collection){
            collection.findOne({email:dadosORS.email}).then(function(result){

                    var cliente_id = result._id;
                    dadosORS.data = date;
                    mongoClient.collection('registosORS', function(err,collection)                        {
                    collection.insert(dadosORS);

                    dadosSessao = {
                        cliente: cliente_id,
                        data: dadosORS.data,
                        numero : dadosORS.sessao
                    }

I believe here is the problem:
mongoClient.collection('registosORS', function(err,collection){
                        collection.findOne({cliente_id:client_id, data:dadosORS.data}).then(function(result){ 
                        console.log(result);

The result is null. Where am I failing?

A:

Have you solved this? 
What should this part resulting in? is it a string of objectID?
var cliente_id = result._id;

if it should be getting the string of objectID and is used for querying then it will not match your string of cliente_id. The var will result in objectID. It should be parsed to JSON and take the objectID first
var cliente_id = result._id.toJSON().$oid

Well it's just my speculation. Hope it helps

