I managed to found out how to delete field but I have a problem It doesn’t really delete it it just set it to NULL.
db.user.update({'username': 'mezo', 'person': {'$in' : ['masidnadi241479214']}}, {'$unset': {'person.$': 1}})
My structure is something like that:
{
"_id" : ObjectId("4ff14c7461d69af811000000"),
"confirmed" : true,
"person" : [
null,
null,
"194724198274192",
"3"
],
"username" : "mezo"
}
Yeah, this behaviour is to be expected. To remove null elements from the array, run
after that $unset operation.