diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index f9b9b1a668..12e53b76fb 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -518,8 +518,9 @@ def update(selector, document, opts={}) # @option opts [Boolean] :unique (false) if true, this index will enforce a uniqueness constraint. # @option opts [Boolean] :background (false) indicate that the index should be built in the background. This # feature is only available in MongoDB >= 1.3.2. - # @option opts [Boolean] :drop_dups (nil) If creating a unique index on a collection with pre-existing records, - # this option will keep the first document the database indexes and drop all subsequent with duplicate values. + # @option opts [Boolean] :drop_dups (nil) (DEPRECATED) If creating a unique index on a collection with + # pre-existing records, this option will keep the first document the database indexes and drop all subsequent + # with duplicate values. # @option opts [Integer] :bucket_size (nil) For use with geoHaystack indexes. Number of documents to group # together within a certain proximity to a given longitude and latitude. # @option opts [Integer] :min (nil) specify the minimum longitude and latitude for a geo index. @@ -545,6 +546,10 @@ def update(selector, document, opts={}) # @example A geospatial index with alternate longitude and latitude: # @restaurants.create_index([['location', Mongo::GEO2D]], :min => 500, :max => 500) # + # @note The :drop_dups option is no longer supported by MongoDB starting with server version 2.7.5. + # The option is silently ignored by the server and unique index builds using the option will + # fail if a duplicate value is detected. + # # @return [String] the name of the index created. def create_index(spec, opts={}) options = opts.dup @@ -572,6 +577,10 @@ def create_index(spec, opts={}) # Time t+10min : @posts.ensure_index(:subject => Mongo::ASCENDING) -- calls create_index and # resets the 5 minute counter # + # @note The :drop_dups option is no longer supported by MongoDB starting with server version 2.7.5. + # The option is silently ignored by the server and unique index builds using the option will + # fail if a duplicate value is detected. + # # @return [String] the name of the index. def ensure_index(spec, opts={}) now = Time.now.utc.to_i