I'm trying to clear roles, and re-push them but I got Exception
$user->set('roles', ); $user->pushFromArray('roles', $roles);
Uncaught exception 'MongoCursorException' with message 'localhost:27017: Cannot update 'roles' and 'roles' at the same time'
same error with
Expressionobject, since this version - arrays and callables also. Some examples at https://github.com/sokil/php-mongo/blob/master/README.md#distinct-values