error ReferenceError: ObjectID is not defined
ObjectID
is not a global variable, it is defined by mongoose (see the documentation):
var fileId = mongoose.Types.ObjectId();
ObjectID
is not a global variable, it is defined by mongoose (see the documentation):
var fileId = mongoose.Types.ObjectId();