Yes. $set and $setOnInsert ye insert hota hai. But $set se hum document ko update karate hai. If vo document exists nahi karata to, $set new create hai hai. And if it exists ho to usako update karata hai. But $setOnInsert only first time insertion ke time value set karata hai. If vo document already exists karata hoga to usako change nahi karega
Sir new video kan aaygi
Start Ho gai
bhai yr ase mat kr $set se bhi to ye kam ho sakta tha....matlab kuch bhi mat padha
Yes. $set and $setOnInsert ye insert hota hai.
But $set se hum document ko update karate hai. If vo document exists nahi karata to, $set new create hai hai. And if it exists ho to usako update karata hai.
But $setOnInsert only first time insertion ke time value set karata hai. If vo document already exists karata hoga to usako change nahi karega