Complex publish with conditionals


#1

hi! my collections have a field “publicado”: true, when is true, all users can see the element. is the way how i can moderate mi “blog”. but, i need this:

when a user create a element, this user can see that element but only elements pending of approval created by him.

 armas.find({'Autor': this.userId , 'publicado': false});

but i need too all the another elements for this collections contain publicado : true

  armas.find({'publicado': true`})

I tried whit a return like 2 collections, but i can. any clue?


#2

Using the $or query operator, you could do something like…

armas.find({
    $or: [
        { Autor: this.userId, publicado: false },
        { publicado: true }
    ]
});

#3

good!, is just i need!