populate mongoose conditional

0

I would like to add some documents to Trades, I have tried to populate and it works, however when a trade does not have documents the query is not executed. I would like to know how I can exclude those who do not have "trade in"

  Oficios.find({}).exec(function(err, oficios){
      File.populate(oficios, {path: "oficioentrada"},function(err, oficios){
        res.json(oficios);
      }); 
  })
    
asked by holman sneyder 09.06.2018 в 03:51
source

0 answers