File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -508,11 +508,26 @@ def drop_index(collection_name, index_name)
508508 # defining the index.
509509 def index_information ( collection_name )
510510 if @client . wire_version_feature? ( Mongo ::MongoClient ::MONGODB_2_8 )
511- result = self . command ( :listIndexes => collection_name ) [ 'indexes' ]
511+ result = self . command ( :listIndexes => collection_name )
512+ if result . key? ( 'cursor' )
513+ cursor_info = result [ 'cursor' ]
514+ pinned_pool = @connection . pinned_pool
515+ pinned_pool = pinned_pool [ :pool ] if pinned_pool . respond_to? ( :keys )
516+
517+ seed = {
518+ :cursor_id => cursor_info [ 'id' ] ,
519+ :first_batch => cursor_info [ 'firstBatch' ] ,
520+ :pool => pinned_pool
521+ }
522+
523+ indexes = Cursor . new ( self , seed . merge! ( opts ) ) . collect { |doc | doc [ 'indexes' ] }
524+ else
525+ indexes = result [ 'indexes' ]
526+ end
512527 else
513- result = legacy_list_indexes ( collection_name )
528+ indexes = legacy_list_indexes ( collection_name )
514529 end
515- result . reduce ( { } ) do |info , index |
530+ indexes . reduce ( { } ) do |info , index |
516531 info . merge! ( index [ 'name' ] => index )
517532 end
518533 end
You can’t perform that action at this time.
0 commit comments