javascript - Finding property in nested array -


i have following schema:

    var searchresults = new mongoose.schema ({         title : string,         url : string,         description : string,         scrapped : {type : boolean, default : false}     }); 

and other 1 :

var searchschema = new mongoose.schema({     original : string,     results : [searchresult],     // ... }); 

how should go searching match url value of result?

i read in question like:

var searchmodel = mongoose.model('search', searchschema); searchmodel.findone({'results.url' : "http://www.myurl.com"}, function (err, res) {     consle.log(res); }); 

but doesn't seem work. syntax wrong?

this syntax correct one, error somewhere else.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -