Object ID Parts It is a 12-byte value consists of 4-byte timestamp value, representing the ObjectId's creation, measured in seconds since the Unix epoch 5-byte random value generated once per process. This random value is unique to the machine and process. 3-byte incrementing counter, initialized to a random value
But what is the use of delete hooks I didn't understand . I tried to implement this userSchema.post('remove',function(doc){ console.log("Db removed",doc) }) For pre also I used remove but noting happened .It didn't remove anything.I didn't understand much from documentation
@@sejalagarwal4867 pre and post is not for deleting the documents from db, they can be use to perform some other tasks before or after deleting the document. Hope now you understood :)
hooks are not working and no error occur as well, please help me the first two pre and post hooks on userschema does not work at my end.Everything else is working.
For better experience and well-organised content Visit - nados.pepcoding.com You can post your query on community tab. Don't forget to follow us on Instagram instagram.com/pepcoding/
why he doesnt make a seprate file for each video ??its kind of confusing ,every previous code in one video only apart from that the tuotorials are very good
🚨 Backend Development: ruclips.net/p/PL-Jc9J83PIiEnK1q9tuVrrORqKBexcE_J
FYI - if the pre and post hooks are not working, just put them above the mongoose.model('userModel',userSchema) function call.
still its not working
saw this comment after wasting a whole day....thanks for help
Really helpful
Object ID Parts
It is a 12-byte value consists of
4-byte timestamp value, representing the ObjectId's creation, measured in seconds since the Unix epoch
5-byte random value generated once per process. This random value is unique to the machine and process.
3-byte incrementing counter, initialized to a random value
Nice explanation!❤️
Your videos is good but sound is to low plz change mike
good teaching
Backend Streak #17
if we want to change something in data or after saving in database we use hooks
mast ekdum
STREAK # 17 🤩👨💻
is it possible to update existing schema in between ? 'Like removing unique constraint from email' ?
nice sir
sir g schema design pa ek video banawo
Remove
It will be used in hook when delete action triggers instead of save.
But what is the use of delete hooks I didn't understand .
I tried to implement this
userSchema.post('remove',function(doc){
console.log("Db removed",doc)
})
For pre also I used remove but noting happened .It didn't remove anything.I didn't understand much from documentation
@@sejalagarwal4867 pre and post is not for deleting the documents from db, they can be use to perform some other tasks before or after deleting the document. Hope now you understood :)
@@omyerawar7976 thanks
hooks are not working and no error occur as well, please help me the first two pre and post hooks on userschema does not work at my end.Everything else is working.
For better experience and well-organised content
Visit - nados.pepcoding.com
You can post your query on community tab.
Don't forget to follow us on Instagram
instagram.com/pepcoding/
bro how you solved this problem
hook is not working with Mongooese 8.5.3 I checked all its not working
why he doesnt make a seprate file for each video ??its kind of confusing ,every previous code in one video only
apart from that the tuotorials are very good
i have also same problem
i cant code it