diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index d7b277a..2e8720f 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -108,6 +108,7 @@ module XGen # Create a new index named +index_name+. +fields+ should be an array # of field names. def create_index(name, *fields) + fields = *fields if fields.kind_of?(Array) && fields.length == 1 @db.create_index(@name, name, fields) end