I would like to get collection count followed by switch case logic depending on the value count returned, but .then is not resolvable? So I need to Promisfy?
FutureTasks.findOne({userid: details.userid}).count
.then(x=> { <==== cannot resolve .then method?
var result;
switch (true) {
case(x > 1): business logic
result = ....
case(x > 0): Some other business logic etc
result = .....
otherwise I am doing
var result;
var x = FutureTasks.findOne({userid: details.userid}).count;
switch (true) {
case (x > 0): etc
case(x > 1): etc
which I am not sure whether x will be ready by the time switch case needs to be evaluated?