MongodB changed from MeteorJS to


Mongodb logic seems to fail after Meteor upgrade?

var p1 = FutureTasks.findOne({userid: details.userid}).count;

seems to give different output and hence not counting as expected? But count is just one my collection attributes and not method:

Schemas.FutureTask = new SimpleSchema({
    userid: {
        type: String,
        label: "USER_ID",
        max: 20,
        optional: true 
    start_date: {
        type: String, 
        label: "START_DATE",
        max: 19,
        optional: true 
    end_date: {
        type: String,
        label: "END_DATE",
        max: 19,
        optional: true
    count: {
        type: Number,
        label: "COUNT",



First, why are you counting a single document? If you want to count things, you should be using find() not findOne().

Second, count is a method and should therefor be count(), not count.


Hi mz103, as pointed out ‘count’ is just one of my Schema attribute names. But for some reason when I refactored into some other name it doesnt like it?


You didn’t clarify that count was a schema attribute name until after my post.

What’s the result of that query (without .count), just the result of FutureTasks.findOne({userid: details.userid}).