File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,22 @@ def collections_info(coll_name=nil)
289289 if @client . wire_version_feature? ( Mongo ::MongoClient ::MONGODB_2_8 )
290290 cmd = BSON ::OrderedHash [ :listCollections , 1 ]
291291 cmd . merge! ( :filter => { :name => coll_name } ) if coll_name
292- self . command ( cmd ) [ 'collections' ]
292+ result = self . command ( cmd )
293+ if result . key? ( 'cursor' )
294+ cursor_info = result [ 'cursor' ]
295+ pinned_pool = @connection . pinned_pool
296+ pinned_pool = pinned_pool [ :pool ] if pinned_pool . respond_to? ( :keys )
297+
298+ seed = {
299+ :cursor_id => cursor_info [ 'id' ] ,
300+ :first_batch => cursor_info [ 'firstBatch' ] ,
301+ :pool => pinned_pool
302+ }
303+
304+ Cursor . new ( self , seed . merge! ( opts ) ) . collect { |doc | doc [ 'collections' ] }
305+ else
306+ result [ 'collections' ]
307+ end
293308 else
294309 legacy_collections_info ( coll_name ) . to_a
295310 end
You can’t perform that action at this time.
0 commit comments