Implements mongo behavior for  on array elements.