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
89742f31
Commit
89742f31
authored
Dec 01, 2016
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #293
parents
7cf94542
fcb17e8b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
29 additions
and
22 deletions
+29
-22
apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
...rgs-MongoDBCollection-method-findOneAndDelete-option.yaml
+2
-2
apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
...gs-MongoDBCollection-method-findOneAndReplace-option.yaml
+2
-2
apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
...rgs-MongoDBCollection-method-findOneAndUpdate-option.yaml
+2
-2
FindAndModify.php
src/Operation/FindAndModify.php
+8
-7
FindOneAndDelete.php
src/Operation/FindOneAndDelete.php
+5
-3
FindOneAndReplace.php
src/Operation/FindOneAndReplace.php
+5
-3
FindOneAndUpdate.php
src/Operation/FindOneAndUpdate.php
+5
-3
No files found.
docs/includes/apiargs-MongoDBCollection-method-findOneAndDelete-option.yaml
View file @
89742f31
...
@@ -18,6 +18,6 @@ source:
...
@@ -18,6 +18,6 @@ source:
file
:
apiargs-MongoDBCollection-common-option.yaml
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
writeConcern
ref
:
writeConcern
post
:
|
post
:
|
This is not supported for server versions prior to 3.2 and will
be ignored if
This is not supported for server versions prior to 3.2 and will
result in an
used.
exception at execution time if
used.
...
...
docs/includes/apiargs-MongoDBCollection-method-findOneAndReplace-option.yaml
View file @
89742f31
...
@@ -39,6 +39,6 @@ source:
...
@@ -39,6 +39,6 @@ source:
file
:
apiargs-MongoDBCollection-common-option.yaml
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
writeConcern
ref
:
writeConcern
post
:
|
post
:
|
This is not supported for server versions prior to 3.2 and will
be ignored if
This is not supported for server versions prior to 3.2 and will
result in an
used.
exception at execution time if
used.
...
...
docs/includes/apiargs-MongoDBCollection-method-findOneAndUpdate-option.yaml
View file @
89742f31
...
@@ -39,6 +39,6 @@ source:
...
@@ -39,6 +39,6 @@ source:
file
:
apiargs-MongoDBCollection-common-option.yaml
file
:
apiargs-MongoDBCollection-common-option.yaml
ref
:
writeConcern
ref
:
writeConcern
post
:
|
post
:
|
This is not supported for server versions prior to 3.2 and will
be ignored if
This is not supported for server versions prior to 3.2 and will
result in an
used.
exception at execution time if
used.
...
...
src/Operation/FindAndModify.php
View file @
89742f31
...
@@ -69,7 +69,8 @@ class FindAndModify implements Executable
...
@@ -69,7 +69,8 @@ class FindAndModify implements Executable
*
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
*
*
* This is not supported for server versions < 3.2.
* This is not supported for server versions < 3.2 and will result in an
* exception at execution time if used.
*
*
* @param string $databaseName Database name
* @param string $databaseName Database name
* @param string $collectionName Collection name
* @param string $collectionName Collection name
...
@@ -144,7 +145,7 @@ class FindAndModify implements Executable
...
@@ -144,7 +145,7 @@ class FindAndModify implements Executable
* @param Server $server
* @param Server $server
* @return object|null
* @return object|null
* @throws UnexpectedValueException if the command response was malformed
* @throws UnexpectedValueException if the command response was malformed
* @throws UnsupportedException if collation is used and unsupported
* @throws UnsupportedException if collation
or write concern
is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
public
function
execute
(
Server
$server
)
public
function
execute
(
Server
$server
)
...
@@ -153,6 +154,10 @@ class FindAndModify implements Executable
...
@@ -153,6 +154,10 @@ class FindAndModify implements Executable
throw
UnsupportedException
::
collationNotSupported
();
throw
UnsupportedException
::
collationNotSupported
();
}
}
if
(
isset
(
$this
->
options
[
'writeConcern'
])
&&
!
\MongoDB\server_supports_feature
(
$server
,
self
::
$wireVersionForWriteConcern
))
{
throw
UnsupportedException
::
writeConcernNotSupported
();
}
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
$this
->
createCommand
(
$server
));
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
$this
->
createCommand
(
$server
));
$result
=
current
(
$cursor
->
toArray
());
$result
=
current
(
$cursor
->
toArray
());
...
@@ -209,11 +214,7 @@ class FindAndModify implements Executable
...
@@ -209,11 +214,7 @@ class FindAndModify implements Executable
$cmd
[
'bypassDocumentValidation'
]
=
$this
->
options
[
'bypassDocumentValidation'
];
$cmd
[
'bypassDocumentValidation'
]
=
$this
->
options
[
'bypassDocumentValidation'
];
}
}
/* In the future, we should throw an exception if the "writeConcern"
if
(
isset
(
$this
->
options
[
'writeConcern'
]))
{
* option is specified and not supported by the server (see: SPEC-494).
* For BC in 1.x, we will silently omit it for incompatible servers.
*/
if
(
isset
(
$this
->
options
[
'writeConcern'
])
&&
\MongoDB\server_supports_feature
(
$server
,
self
::
$wireVersionForWriteConcern
))
{
$cmd
[
'writeConcern'
]
=
\MongoDB\write_concern_as_document
(
$this
->
options
[
'writeConcern'
]);
$cmd
[
'writeConcern'
]
=
\MongoDB\write_concern_as_document
(
$this
->
options
[
'writeConcern'
]);
}
}
...
...
src/Operation/FindOneAndDelete.php
View file @
89742f31
...
@@ -37,8 +37,10 @@ class FindOneAndDelete implements Executable
...
@@ -37,8 +37,10 @@ class FindOneAndDelete implements Executable
* * sort (document): Determines which document the operation modifies if
* * sort (document): Determines which document the operation modifies if
* the query selects multiple documents.
* the query selects multiple documents.
*
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This option
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
* is only supported for server versions >= 3.2.
*
* This is not supported for server versions < 3.2 and will result in an
* exception at execution time if used.
*
*
* @param string $databaseName Database name
* @param string $databaseName Database name
* @param string $collectionName Collection name
* @param string $collectionName Collection name
...
@@ -75,7 +77,7 @@ class FindOneAndDelete implements Executable
...
@@ -75,7 +77,7 @@ class FindOneAndDelete implements Executable
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return object|null
* @throws UnsupportedException if collation is used and unsupported
* @throws UnsupportedException if collation
or write concern
is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
public
function
execute
(
Server
$server
)
public
function
execute
(
Server
$server
)
...
...
src/Operation/FindOneAndReplace.php
View file @
89742f31
...
@@ -52,8 +52,10 @@ class FindOneAndReplace implements Executable
...
@@ -52,8 +52,10 @@ class FindOneAndReplace implements Executable
* * upsert (boolean): When true, a new document is created if no document
* * upsert (boolean): When true, a new document is created if no document
* matches the query. The default is false.
* matches the query. The default is false.
*
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This option
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
* is only supported for server versions >= 3.2.
*
* This is not supported for server versions < 3.2 and will result in an
* exception at execution time if used.
*
*
* @param string $databaseName Database name
* @param string $databaseName Database name
* @param string $collectionName Collection name
* @param string $collectionName Collection name
...
@@ -115,7 +117,7 @@ class FindOneAndReplace implements Executable
...
@@ -115,7 +117,7 @@ class FindOneAndReplace implements Executable
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return object|null
* @throws UnsupportedException if collation is used and unsupported
* @throws UnsupportedException if collation
or write concern
is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
public
function
execute
(
Server
$server
)
public
function
execute
(
Server
$server
)
...
...
src/Operation/FindOneAndUpdate.php
View file @
89742f31
...
@@ -52,8 +52,10 @@ class FindOneAndUpdate implements Executable
...
@@ -52,8 +52,10 @@ class FindOneAndUpdate implements Executable
* * upsert (boolean): When true, a new document is created if no document
* * upsert (boolean): When true, a new document is created if no document
* matches the query. The default is false.
* matches the query. The default is false.
*
*
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern. This option
* * writeConcern (MongoDB\Driver\WriteConcern): Write concern.
* is only supported for server versions >= 3.2.
*
* This is not supported for server versions < 3.2 and will result in an
* exception at execution time if used.
*
*
* @param string $databaseName Database name
* @param string $databaseName Database name
* @param string $collectionName Collection name
* @param string $collectionName Collection name
...
@@ -115,7 +117,7 @@ class FindOneAndUpdate implements Executable
...
@@ -115,7 +117,7 @@ class FindOneAndUpdate implements Executable
* @see Executable::execute()
* @see Executable::execute()
* @param Server $server
* @param Server $server
* @return object|null
* @return object|null
* @throws UnsupportedException if collation is used and unsupported
* @throws UnsupportedException if collation
or write concern
is used and unsupported
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
* @throws DriverRuntimeException for other driver errors (e.g. connection errors)
*/
*/
public
function
execute
(
Server
$server
)
public
function
execute
(
Server
$server
)
...
...
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