Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
0f91e9f3
Commit
0f91e9f3
authored
Feb 22, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add writeConcern to Delete and Update
parent
c6a2df9a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
4 deletions
+18
-4
Delete.php
src/Operation/Delete.php
+7
-1
Explainable.php
src/Operation/Explainable.php
+0
-2
Update.php
src/Operation/Update.php
+11
-1
No files found.
src/Operation/Delete.php
View file @
0f91e9f3
...
...
@@ -127,7 +127,13 @@ class Delete implements Executable, Explainable
public
function
getCommandDocument
()
{
return
[
'delete'
=>
$this
->
collectionName
,
'deletes'
=>
[[
'q'
=>
$this
->
filter
]
+
$this
->
createDeleteOptions
()]];
$cmd
=
[
'delete'
=>
$this
->
collectionName
,
'deletes'
=>
[[
'q'
=>
$this
->
filter
]
+
$this
->
createDeleteOptions
()]];
if
(
isset
(
$this
->
options
[
'writeConcern'
]))
{
$cmd
[
'writeConcern'
]
=
$this
->
options
[
'writeConcern'
];
}
return
$cmd
;
}
/**
...
...
src/Operation/Explainable.php
View file @
0f91e9f3
...
...
@@ -17,8 +17,6 @@
namespace
MongoDB\Operation
;
use
MongoDB\Driver\Server
;
/**
* Explainable interface for explainable operations (count, distinct, find,
* findAndModify, delete, and update).
...
...
src/Operation/Update.php
View file @
0f91e9f3
...
...
@@ -183,7 +183,17 @@ class Update implements Executable, Explainable
public
function
getCommandDocument
()
{
return
[
'update'
=>
$this
->
collectionName
,
'updates'
=>
[[
'q'
=>
$this
->
filter
,
'u'
=>
$this
->
update
]
+
$this
->
createUpdateOptions
()]];
$cmd
=
[
'update'
=>
$this
->
collectionName
,
'updates'
=>
[[
'q'
=>
$this
->
filter
,
'u'
=>
$this
->
update
]
+
$this
->
createUpdateOptions
()]];
if
(
isset
(
$this
->
options
[
'writeConcern'
]))
{
$cmd
[
'writeConcern'
]
=
$this
->
options
[
'writeConcern'
];
}
if
(
isset
(
$this
->
options
[
'bypassDocumentValidation'
])
&&
\MongoDB\server_supports_feature
(
$server
,
self
::
$wireVersionForDocumentLevelValidation
))
{
$cmd
[
'bypassDocumentValidation'
]
=
$this
->
options
[
'bypassDocumentValidation'
];
}
return
$cmd
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment