You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, if a document TestDocument has multiple referencing User collection, and a particular TestDocument document is referencing one document in User, when the latter is removed, we should make only single operation to update all those fields in the TestDocument document.
Currently we do multiple operations, which means that further observe callbacks are triggered but now the document referenced in fields not yet updated does not exist, so an error is shown.
Meteor 1.7 updated MongoDB to 3.6.4 so for those versions we could update our looping updates over array elements to do that in one operation.
If we could do also other operations all together then we should probably at every change do one update to update all fields at once. Current logic setups multiple observes for each field and is updating one by one.
Document 'TestDocument' 'cccc' field 'userPermissions.addedBy' is referencing a nonexistent document 'aaaa'
This is because subdocument with user_.id == 'aaaa' is pulled from the array, which triggers an update with subdocument with addedBy._id === 'aaaa' still there.
The text was updated successfully, but these errors were encountered:
For example, if a document
TestDocument
has multiple referencingUser
collection, and a particularTestDocument
document is referencing one document inUser
, when the latter is removed, we should make only single operation to update all those fields in theTestDocument
document.Currently we do multiple operations, which means that further observe callbacks are triggered but now the document referenced in fields not yet updated does not exist, so an error is shown.
It seems not not all operations can be yet be made so (see https://jira.mongodb.org/browse/SERVER-6566), but ones wher we loop and update each element in an array could since 3.5.2 (see https://jira.mongodb.org/browse/SERVER-1243).
Meteor 1.7 updated MongoDB to 3.6.4 so for those versions we could update our looping updates over array elements to do that in one operation.
If we could do also other operations all together then we should probably at every change do one update to update all fields at once. Current logic setups multiple observes for each field and is updating one by one.
A test for the example above is:
When this is ran the following error is seen:
This is because subdocument with
user_.id == 'aaaa'
is pulled from the array, which triggers an update with subdocument withaddedBy._id === 'aaaa'
still there.The text was updated successfully, but these errors were encountered: