File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/Jenssegers/Mongodb/Schema Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ public function hasCollection($name)
40
40
{
41
41
$ db = $ this ->connection ->getMongoDB ();
42
42
43
- $ collections = $ db ->listCollections ([
43
+ $ collections = iterator_to_array ( $ db ->listCollections ([
44
44
'filter ' => [
45
45
'name ' => $ name ,
46
46
],
47
- ]);
47
+ ]), false ) ;
48
48
49
- return $ collections -> count () ? true : false ;
49
+ return count ($ collections ) ? true : false ;
50
50
}
51
51
52
52
/**
@@ -143,13 +143,13 @@ public function getCollection($name)
143
143
{
144
144
$ db = $ this ->connection ->getMongoDB ();
145
145
146
- $ collections = $ db ->listCollections ([
146
+ $ collections = iterator_to_array ( $ db ->listCollections ([
147
147
'filter ' => [
148
148
'name ' => $ name ,
149
149
],
150
- ]);
150
+ ]), false ) ;
151
151
152
- return $ collections -> count () ? (( $ collections = iterator_to_array ( $ collections ) ) ? current ($ collections) : false ) : false ;
152
+ return count ($ collections) ? current ($ collections ) : false ;
153
153
}
154
154
155
155
/**
You can’t perform that action at this time.
0 commit comments