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
f3e9e1e9
Commit
f3e9e1e9
authored
Jul 27, 2015
by
Derick Rethans
Committed by
Jeremy Mikola
Aug 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-118: Specify "root" option in typemap, as it's separate from "document"
parent
ab3f0510
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
9 deletions
+9
-9
Count.php
src/Operation/Count.php
+1
-1
CreateIndexes.php
src/Operation/CreateIndexes.php
+1
-1
ListCollections.php
src/Operation/ListCollections.php
+2
-2
ListDatabases.php
src/Operation/ListDatabases.php
+1
-1
ListIndexes.php
src/Operation/ListIndexes.php
+2
-2
FunctionalTestCase.php
tests/FunctionalTestCase.php
+2
-2
No files found.
src/Operation/Count.php
View file @
f3e9e1e9
...
@@ -85,7 +85,7 @@ class Count implements Executable
...
@@ -85,7 +85,7 @@ class Count implements Executable
public
function
execute
(
Server
$server
)
public
function
execute
(
Server
$server
)
{
{
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
$this
->
createCommand
());
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
$this
->
createCommand
());
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
$result
=
current
(
$cursor
->
toArray
());
$result
=
current
(
$cursor
->
toArray
());
if
(
empty
(
$result
[
'ok'
]))
{
if
(
empty
(
$result
[
'ok'
]))
{
...
...
src/Operation/CreateIndexes.php
View file @
f3e9e1e9
...
@@ -91,7 +91,7 @@ class CreateIndexes implements Executable
...
@@ -91,7 +91,7 @@ class CreateIndexes implements Executable
));
));
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
$command
);
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
$command
);
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
$result
=
current
(
$cursor
->
toArray
());
$result
=
current
(
$cursor
->
toArray
());
if
(
empty
(
$result
[
'ok'
]))
{
if
(
empty
(
$result
[
'ok'
]))
{
...
...
src/Operation/ListCollections.php
View file @
f3e9e1e9
...
@@ -85,7 +85,7 @@ class ListCollections implements Executable
...
@@ -85,7 +85,7 @@ class ListCollections implements Executable
}
}
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
new
Command
(
$cmd
));
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
new
Command
(
$cmd
));
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
return
new
CollectionInfoCommandIterator
(
$cursor
);
return
new
CollectionInfoCommandIterator
(
$cursor
);
}
}
...
@@ -115,7 +115,7 @@ class ListCollections implements Executable
...
@@ -115,7 +115,7 @@ class ListCollections implements Executable
:
array
();
:
array
();
$cursor
=
$server
->
executeQuery
(
$this
->
databaseName
.
'.system.namespaces'
,
new
Query
(
$filter
,
$options
));
$cursor
=
$server
->
executeQuery
(
$this
->
databaseName
.
'.system.namespaces'
,
new
Query
(
$filter
,
$options
));
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
return
new
CollectionInfoLegacyIterator
(
$cursor
);
return
new
CollectionInfoLegacyIterator
(
$cursor
);
}
}
...
...
src/Operation/ListDatabases.php
View file @
f3e9e1e9
...
@@ -55,7 +55,7 @@ class ListDatabases implements Executable
...
@@ -55,7 +55,7 @@ class ListDatabases implements Executable
}
}
$cursor
=
$server
->
executeCommand
(
'admin'
,
new
Command
(
$cmd
));
$cursor
=
$server
->
executeCommand
(
'admin'
,
new
Command
(
$cmd
));
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
$result
=
current
(
$cursor
->
toArray
());
$result
=
current
(
$cursor
->
toArray
());
if
(
empty
(
$result
[
'ok'
]))
{
if
(
empty
(
$result
[
'ok'
]))
{
...
...
src/Operation/ListIndexes.php
View file @
f3e9e1e9
...
@@ -76,7 +76,7 @@ class ListIndexes implements Executable
...
@@ -76,7 +76,7 @@ class ListIndexes implements Executable
}
}
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
new
Command
(
$cmd
));
$cursor
=
$server
->
executeCommand
(
$this
->
databaseName
,
new
Command
(
$cmd
));
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
return
new
IndexInfoIteratorIterator
(
$cursor
);
return
new
IndexInfoIteratorIterator
(
$cursor
);
}
}
...
@@ -97,7 +97,7 @@ class ListIndexes implements Executable
...
@@ -97,7 +97,7 @@ class ListIndexes implements Executable
:
array
();
:
array
();
$cursor
=
$server
->
executeQuery
(
$this
->
databaseName
.
'.system.indexes'
,
new
Query
(
$filter
,
$options
));
$cursor
=
$server
->
executeQuery
(
$this
->
databaseName
.
'.system.indexes'
,
new
Query
(
$filter
,
$options
));
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
return
new
IndexInfoIteratorIterator
(
$cursor
);
return
new
IndexInfoIteratorIterator
(
$cursor
);
}
}
...
...
tests/FunctionalTestCase.php
View file @
f3e9e1e9
...
@@ -23,7 +23,7 @@ abstract class FunctionalTestCase extends TestCase
...
@@ -23,7 +23,7 @@ abstract class FunctionalTestCase extends TestCase
list
(
$databaseName
,
$collectionName
)
=
explode
(
'.'
,
$namespace
,
2
);
list
(
$databaseName
,
$collectionName
)
=
explode
(
'.'
,
$namespace
,
2
);
$cursor
=
$this
->
manager
->
executeCommand
(
$databaseName
,
new
Command
(
array
(
'count'
=>
$collectionName
)));
$cursor
=
$this
->
manager
->
executeCommand
(
$databaseName
,
new
Command
(
array
(
'count'
=>
$collectionName
)));
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
$document
=
current
(
$cursor
->
toArray
());
$document
=
current
(
$cursor
->
toArray
());
$this
->
assertArrayHasKey
(
'n'
,
$document
);
$this
->
assertArrayHasKey
(
'n'
,
$document
);
...
@@ -76,7 +76,7 @@ abstract class FunctionalTestCase extends TestCase
...
@@ -76,7 +76,7 @@ abstract class FunctionalTestCase extends TestCase
$readPreference
?:
new
ReadPreference
(
ReadPreference
::
RP_PRIMARY
)
$readPreference
?:
new
ReadPreference
(
ReadPreference
::
RP_PRIMARY
)
);
);
$cursor
->
setTypeMap
(
array
(
'document'
=>
'array'
));
$cursor
->
setTypeMap
(
array
(
'
root'
=>
'array'
,
'
document'
=>
'array'
));
$document
=
current
(
$cursor
->
toArray
());
$document
=
current
(
$cursor
->
toArray
());
return
$document
[
'version'
];
return
$document
[
'version'
];
...
...
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