lib/mongo/database/view.rb in mongo-2.1.0.rc0 vs lib/mongo/database/view.rb in mongo-2.1.0
- old
+ new
@@ -49,13 +49,14 @@
#
# @since 2.0.0
def collection_names(options = {})
@batch_size = options[:batch_size]
server = next_primary
+ @limit = -1 if server.features.list_collections_enabled?
collections_info(server).collect do |info|
- server.context.features.list_collections_enabled? ?
- info['name'] : info['name'].sub("#{@database.name}.", '')
+ server.features.list_collections_enabled? ?
+ info[Database::NAME] : info[Database::NAME].sub("#{@database.name}.", '')
end
end
# Get info on all the collections in the database.
#
@@ -78,10 +79,10 @@
#
# @since 2.0.0
def initialize(database)
@database = database
@batch_size = nil
- @limit = -1
+ @limit = nil
@collection = @database[Database::COMMAND]
end
private