0
Par exemple, supposons que j'ai un schéma Post comme suit:Comment puis-je rechercher une collection intégrée dans MongoDB?
var Schema = new db.Schema({
title : String
, text : String
// Denormalize by using user name
, author : String
, tags: [String]
, comments: [Comment]
});
Je suis en train de faire correspondre une balise particulière comme suit:
function getPostByTag(tag, callback) {
Post.find().where({"tags.value": tag}).run(callback);
}
Mais il est tout retour. Qu'est-ce que je fais mal?