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)
4040 {
4141 $ db = $ this ->connection ->getMongoDB ();
4242
43- $ collections = $ db ->listCollections ([
43+ $ collections = iterator_to_array ( $ db ->listCollections ([
4444 'filter ' => [
4545 'name ' => $ name ,
4646 ],
47- ]);
47+ ]), false ) ;
4848
49- return $ collections -> count () ? true : false ;
49+ return count ($ collections ) ? true : false ;
5050 }
5151
5252 /**
@@ -143,13 +143,13 @@ public function getCollection($name)
143143 {
144144 $ db = $ this ->connection ->getMongoDB ();
145145
146- $ collections = $ db ->listCollections ([
146+ $ collections = iterator_to_array ( $ db ->listCollections ([
147147 'filter ' => [
148148 'name ' => $ name ,
149149 ],
150- ]);
150+ ]), false ) ;
151151
152- return $ collections -> count () ? (( $ collections = iterator_to_array ( $ collections ) ) ? current ($ collections) : false ) : false ;
152+ return count ($ collections) ? current ($ collections ) : false ;
153153 }
154154
155155 /**
You can’t perform that action at this time.
0 commit comments