MongoDB update performance with many embedded documents
Using a large number of embedded documents within one document may lead to performance issues for update queries, when embedded documents have an indexed field.
Sometimes this data model is OK, because updates take place in background processes. But in this case an update can result in a timeout. To avoid this you can increase the socketTimeoutMS (default is 30000, 30 seconds):