Mongoose - add method to object that is returned in the callback

Is there a way to add functions to the object that is returned in the callback?

User.find({'age':'20'}, function(err, users){
    users.function();
});

It seems statics only work on the model. Schematically :

User.static();

and methods only work on instances

(new User()).method();

None of them seem to work on users, which i think is just a normal js Object variable. Am I missing something ?

The Schema.method description, from the docs:

Adds an instance method to documents constructed from Models compiled from this schema.

So, if you do something like this:

var userSchema = new Schema({
    username: String,
    age: Number
});

userSchema.method('showAge', function () {
    return this.age;
});

, and call your method in a document returned from a query like:

User.findOne({'age':'20'}, function(err, user){
    console.log(user.showAge());
});

it should work. Maybe you're having problems because you're calling your method users.function() in an array. Remember: the find method returns an array of documents.