@@ -94,14 +94,15 @@ public function executeQuery($namespace, Query $query, ReadPreference $readPrefe
94
94
/**
95
95
* @param string $namespace
96
96
* @param WriteBatch $batch
97
+ * @param array $writeOptions Ordering and write concern options (default: {"ordered": true, "w": 1})
97
98
* @return WriteResult
98
99
*/
99
- public function executeWrite ($ namespace , WriteBatch $ batch )
100
+ public function executeWrite ($ namespace , WriteBatch $ batch, array $ writeOptions = null )
100
101
{
101
102
/* Select writeable server and invoke Server::executeQuery().
102
103
*
103
- * Write options are not taken as an argument, since they are specified
104
- * during WriteBatch construction .
104
+ * Write options are optional, and will be merged into the default,
105
+ * which is {"ordered": true, "w": 1} .
105
106
*
106
107
* On error, we should consider throwing:
107
108
*
@@ -119,12 +120,16 @@ public function executeWrite($namespace, WriteBatch $batch)
119
120
*
120
121
* @param string $namespace
121
122
* @param array|object $document Document to insert
122
- * @param array $writeOptions Write concern options
123
+ * @param array $writeOptions Write concern options (default: {"w": 1})
123
124
* @return InsertResult
124
125
*/
125
126
public function executeInsert ($ namespace , $ document , array $ writeOptions = null )
126
127
{
127
- // Construct and execute an InsertBatch
128
+ /* Construct and execute an InsertBatch
129
+ *
130
+ * Write options are optional, and will be merged into the default,
131
+ * which is {"w": 1}.
132
+ */
128
133
}
129
134
130
135
/**
@@ -134,12 +139,15 @@ public function executeInsert($namespace, $document, array $writeOptions = null)
134
139
* @param array|object $query Update criteria
135
140
* @param array|object $newObj Update modifier or replacement document
136
141
* @param array $updateOptions Update options (e.g. "upsert")
137
- * @param array $writeOptions Write concern options
142
+ * @param array $writeOptions Write concern options (default: {"w": 1})
138
143
* @return UpdateResult
139
144
*/
140
145
public function executeUpdate ($ namespace , $ query , $ newObj , array $ updateOptions = null , array $ writeOptions = null )
141
146
{
142
147
/* Construct and execute an UpdateBatch
148
+ *
149
+ * Write options are optional, and will be merged into the default,
150
+ * which is {"w": 1}.
143
151
*
144
152
* What should be the default value for $options? No multi, no upsert?
145
153
*/
@@ -151,12 +159,15 @@ public function executeUpdate($namespace, $query, $newObj, array $updateOptions
151
159
* @param string $namespace
152
160
* @param array|object $query Deletion criteria
153
161
* @param array $deleteOptions Deletion options (e.g. "limit")
154
- * @param array $writeOptions Write concern options
162
+ * @param array $writeOptions Write concern options (default: {"w": 1})
155
163
* @return DeleteResult
156
164
*/
157
165
public function executeDelete ($ namespace , $ query , array $ deleteOptions = null , array $ writeOptions = null )
158
166
{
159
167
/* Construct and execute an DeleteBatch
168
+ *
169
+ * Write options are optional, and will be merged into the default,
170
+ * which is {"w": 1}.
160
171
*
161
172
* What should be the default value for $options? No limit?
162
173
*/
0 commit comments