I have a document in mongodb that looks like this
{
"_id": ObjectId("5378da275ad972a811c119fb"),
"name": "test test",
"fname": "test",
"lname": "test",
"phone": "13254355554",
"user": "525518965ad972636d7aa0ae",
}
And i want to insert a new field for "employee_id" so the result should be exactly like this.
{
"_id": ObjectId("5378da275ad972a811c119fb"),
"name": "test test",
"fname": "test",
"lname": "test",
"employee_id": "09872",
"phone": "13254355554",
"user": "525518965ad972636d7aa0ae",
}
I have used $push and $addToSet but the results became an array like
"employee_id": {
"0": "09872",
}