MongodB changed from MeteorJS 1.3.2.4 to 1.4.1.1?


#1

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",
        optional:true
    }

});

#2

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.


#3

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?


#4

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}).