diff --git a/en/reference/query-builder-api.rst b/en/reference/query-builder-api.rst index eb6eb067b1..5fd5bd45db 100644 --- a/en/reference/query-builder-api.rst +++ b/en/reference/query-builder-api.rst @@ -492,6 +492,7 @@ Change a users password: createQueryBuilder('User') + ->update() ->field('password')->set('newpassword') ->field('username')->equals('jwage') ->getQuery() @@ -506,6 +507,7 @@ tell it the update is not an atomic one: createQueryBuilder('User') + ->update() ->field('username')->set('jwage', false) ->field('password')->set('password', false) // ... set other remaining fields @@ -557,6 +559,7 @@ exists: createQueryBuilder('User') + ->update() ->field('login')->unsetField()->exists(true) ->getQuery() ->execute(); @@ -572,6 +575,7 @@ Append new tag to the tags array: createQueryBuilder('Article') + ->update() ->field('tags')->push('tag5') ->field('id')->equals('theid') ->getQuery() @@ -588,6 +592,7 @@ Append new tags to the tags array: createQueryBuilder('Article') + ->update() ->field('tags')->pushAll(array('tag6', 'tag7')) ->field('id')->equals('theid') ->getQuery() @@ -604,6 +609,7 @@ Add value to array only if its not in the array already: createQueryBuilder('Article') + ->update() ->field('tags')->addToSet('tag1') ->field('id')->equals('theid') ->getQuery() @@ -621,6 +627,7 @@ already: createQueryBuilder('Article') + ->update() ->field('tags')->addManyToSet(array('tag6', 'tag7')) ->field('id')->equals('theid') ->getQuery() @@ -637,6 +644,7 @@ Remove first element in an array: createQueryBuilder('Article') + ->update() ->field('tags')->popFirst() ->field('id')->equals('theid') ->getQuery() @@ -649,6 +657,7 @@ Remove last element in an array: createQueryBuilder('Article') + ->update() ->field('tags')->popLast() ->field('id')->equals('theid') ->getQuery() @@ -665,6 +674,7 @@ Remove all occurrences of value from array: createQueryBuilder('Article') + ->update() ->field('tags')->pull('tag1') ->getQuery() ->execute(); @@ -678,6 +688,7 @@ in the Mongo docs. createQueryBuilder('Article') + ->update() ->field('tags')->pullAll(array('tag1', 'tag2')) ->getQuery() ->execute();