No, is related to a need.
My need is to be able to use writeConcern option to allow async write operations.
I'd like to pass options parameter to insert and delete methods, as it already happens for update method.
I've already created a PR #2029
@danielerota can you show example for this async write operation?
@Smolevich I need to log API operation, so the code can't stop if log insert (into mongodb) fail.
An example call here:
$collection = app('db')->connection('mongodb')->collection('characters');
try {
$collection->insert(array("_id"=>"unique21"), array("writeConcern" => new WriteConcern(0)));
}catch (\Exception $e) { }
This specific usage is useful in case you are not interested about the status of the operation (e.g. for logging). In this way you don't have to wait for the acknowledge from MongoDB and the script can continue the execution, saving time.
However, the options array can contain other useful MongoDB options. Currently, only update method handles the $options parameter, so I think id would be right that also insert and delete support it.
I need this feature addition as well
I need this feature addition as well
+1
+1
+1
+1
+1
+1
Most helpful comment
I need this feature addition as well