MongoDB update a field if the subdocument exists
I only find questions about the other way around. But in my case I need to update a subdocument auditInfo which might or might not exist. In case it does not exist, it should be ignored. But using the $set…