-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 2.1.1
-
Component/s: None
-
None
It appears that the $pullAll operator is implemented inefficiently. The current implementation loops over the target array and for each element, loops over the set of things to pull. So if you are pulling m elements from an array of size n, this takes O(n*m) time. It is possible to do this in O(n+m) by using a hash table to loop once over things to pull, then once over the target array. The difference might be noticeable for large values of m and n.