I want to update a array value but i am not sure about the proper method to do it ,so for i tried following method but didnt worked for me.
My model, The childre
This will help I guess
Employeehierarchy.findOneAndUpdate( { _id:employeeparent._id }, { $set: { "childrens": employee._id }} )