![javascript](https://habrastorage.org/r/w120/webt/59/cc/76/59cc7600c78a2239379574.jpeg)
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})
})