JavaScript
- 3 ответа
- 0 вопросов
0
Вклад в тег
Meteor.publish('current-game', function(){
let options = {limit: 1, fields: {myTurn: 0}}
const myTurn = Games.findOne({users: this.userId, nextPlayer: this.userId, finished: {$exists: false}}))
if (myTurn){
options.fields.myTurn=1
}
return Games.find({users: this.userId, finished: {$exists: false}}, {limit: 1})
})