File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1159,6 +1159,26 @@ protected function _massageAggregateOptions($options)
1159
1159
return $ options ;
1160
1160
}
1161
1161
1162
+ /**
1163
+ * Internal helper for massaging findandmodify options
1164
+ * @internal
1165
+ */
1166
+ final protected function _massageFindAndModifyOptions ($ options , $ update = array ())
1167
+ {
1168
+ $ ret = array (
1169
+ "sort " => $ options ["sort " ],
1170
+ "new " => isset ($ options ["returnDocument " ]) ? $ options ["returnDocument " ] == self ::FIND_ONE_AND_RETURN_AFTER : false ,
1171
+ "fields " => $ options ["projection " ],
1172
+ "upsert " => isset ($ options ["upsert " ]) ? $ options ["upsert " ] : false ,
1173
+ );
1174
+ if ($ update ) {
1175
+ $ ret ["update " ] = $ update ;
1176
+ } else {
1177
+ $ ret ["remove " ] = true ;
1178
+ }
1179
+ return $ ret ;
1180
+ }
1181
+
1162
1182
/**
1163
1183
* Constructs the Query Wire Protocol field 'flags' based on $options
1164
1184
* provided to other helpers
You can’t perform that action at this time.
0 commit comments