Determine if a record "is new" in the pre save callback

Yes, there's an isNew boolean property on a model instance that indicates that. Access it as this.isNew from your pre save middleware.


var MySchema = new Schema({...});

MySchema.pre('save', function(next) {
    if (this.isNew) {
        // Hooray !
    }
    next();
});