@@ -55,24 +55,25 @@ $jonpall_id = $bulk->insert($jonpall);
55
55
* #1 (array|object): search criteria to select the document(s) for updating
56
56
* #2 (array|object): replacement document or atomic operations to apply
57
57
* #3 (array): update options
58
- * * limit (integer ): Updates all matching documents when 0 (false).
59
- * Otherwise, only the first matching document is updated.
58
+ * * multi (boolean ): Updates all matching documents when true; otherwise,
59
+ * only the first matching document is updated. Defaults to false .
60
60
* * upsert (boolean): If there is no matching document, create a new
61
- * document from $filter and $update. */
61
+ * document from the first two arguments. Defaults to false.
62
+ */
62
63
$bulk->update(
63
64
["_id" => $hayley_id],
64
65
['$set' => ["citizen" => "Iceland"]],
65
- ["limit " => 1 , "upsert" => false]
66
+ ["multi " => false , "upsert" => false]
66
67
);
67
68
$bulk->update(
68
69
["citizen" => "Iceland"],
69
70
['$set' => ["viking" => true]],
70
- ["limit " => 0 , "upsert" => false]
71
+ ["multi " => true , "upsert" => false]
71
72
);
72
73
$bulk->update(
73
74
["name" => "Chuck Norris"],
74
75
['$set' => ["viking" => false]],
75
- ["limit " => 1 , "upsert" => true]
76
+ ["multi " => false , "upsert" => true]
76
77
];
77
78
78
79
?>
0 commit comments