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
c319939b
Commit
c319939b
authored
Aug 15, 2018
by
Derick Rethans
Browse files
Options
Browse Files
Download
Plain Diff
Merged pull request #573
parents
dc1665a6
7beed248
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
DocumentationExamplesTest.php
tests/DocumentationExamplesTest.php
+19
-6
No files found.
tests/DocumentationExamplesTest.php
View file @
c319939b
...
...
@@ -1411,11 +1411,10 @@ class DocumentationExamplesTest extends FunctionalTestCase
// Prep
$client
=
new
Client
(
$this
->
getUri
());
$
test
=
$client
->
selectDatabase
(
$
items
=
$client
->
selectDatabase
(
'test'
,
[
'writeConcern'
=>
new
WriteConcern
(
WriteConcern
::
MAJORITY
)
]
);
$items
=
$client
->
test
->
items
;
)
->
items
;
$items
->
drop
();
$items
->
insertOne
(
...
...
@@ -1423,17 +1422,27 @@ class DocumentationExamplesTest extends FunctionalTestCase
);
// Start Causal Consistency Example 1
$items
=
$client
->
selectDatabase
(
'test'
,
[
'readConcern'
=>
new
\MongoDB\Driver\ReadConcern
(
\MongoDB\Driver\ReadConcern
::
MAJORITY
),
'writeConcern'
=>
new
\MongoDB\Driver\WriteConcern
(
\MongoDB\Driver\WriteConcern
::
MAJORITY
,
1000
),
]
)
->
items
;
$s1
=
$client
->
startSession
(
[
'causalConsistency'
=>
true
]
);
$currentDate
=
new
\MongoDB\BSON\UTCDateTime
();
$items
->
updateOne
(
[
'sku'
=>
'111'
,
'end'
=>
[
'$exists'
=>
false
]
],
[
'$
currentDate'
=>
[
'end'
=>
tru
e
]
],
[
'$
set'
=>
[
'end'
=>
$currentDat
e
]
],
[
'session'
=>
$s1
]
);
$items
->
insertOne
(
[
'sku'
=>
'111-nuts'
,
'name'
=>
'Pecans'
,
'start'
=>
new
\MongoDB\BSON\UTCDateTime
()
],
[
'sku'
=>
'111-nuts'
,
'name'
=>
'Pecans'
,
'start'
=>
$currentDate
],
[
'session'
=>
$s1
]
);
// End Causal Consistency Example 1
...
...
@@ -1449,7 +1458,11 @@ class DocumentationExamplesTest extends FunctionalTestCase
$items
=
$client
->
selectDatabase
(
'test'
,
[
'readPreference'
=>
new
\MongoDB\Driver\ReadPreference
(
\MongoDB\Driver\ReadPreference
::
RP_SECONDARY
)
]
[
'readPreference'
=>
new
\MongoDB\Driver\ReadPreference
(
\MongoDB\Driver\ReadPreference
::
RP_SECONDARY
),
'readConcern'
=>
new
\MongoDB\Driver\ReadConcern
(
\MongoDB\Driver\ReadConcern
::
MAJORITY
),
'writeConcern'
=>
new
\MongoDB\Driver\WriteConcern
(
\MongoDB\Driver\WriteConcern
::
MAJORITY
,
1000
)
]
)
->
items
;
$result
=
$items
->
find
(
...
...
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