From 140dfa9f32a670624e07e043d3771fd2ebba9c3e Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Tue, 12 Apr 2011 15:01:40 -0400 Subject: [PATCH] minor: fixes --- lib/mongo/collection.rb | 18 +++++++++++------- test/replica_sets/connect_test.rb | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lib/mongo/collection.rb b/lib/mongo/collection.rb index 0d06cde..6283206 100644 --- a/lib/mongo/collection.rb +++ b/lib/mongo/collection.rb @@ -147,16 +147,20 @@ module Mongo # @option opts [Integer] :limit maximum number of documents to return # @option opts [Array] :sort an array of [key, direction] pairs to sort by. Direction should # be specified as Mongo::ASCENDING (or :ascending / :asc) or Mongo::DESCENDING (or :descending / :desc) - # @option opts [String, Array, OrderedHash] :hint hint for query optimizer, usually not necessary if using MongoDB > 1.1 + # @option opts [String, Array, OrderedHash] :hint hint for query optimizer, usually not necessary if + # using MongoDB > 1.1 # @option opts [Boolean] :snapshot (false) if true, snapshot mode will be used for this query. # Snapshot mode assures no duplicates are returned, or objects missed, which were preset at both the start and - # end of the query's execution. For details see http://www.mongodb.org/display/DOCS/How+to+do+Snapshotting+in+the+Mongo+Database - # @option opts [Boolean] :batch_size (100) the number of documents to returned by the database per GETMORE operation. A value of 0 - # will let the database server decide how many results to returns. This option can be ignored for most use cases. + # end of the query's execution. + # For details see http://www.mongodb.org/display/DOCS/How+to+do+Snapshotting+in+the+Mongo+Database + # @option opts [Boolean] :batch_size (100) the number of documents to returned by the database per + # GETMORE operation. A value of 0 will let the database server decide how many results to returns. + # This option can be ignored for most use cases. # @option opts [Boolean] :timeout (true) when +true+, the returned cursor will be subject to - # the normal cursor timeout behavior of the mongod process. When +false+, the returned cursor will never timeout. Note - # that disabling timeout will only work when #find is invoked with a block. This is to prevent any inadvertant failure to - # close the cursor, as the cursor is explicitly closed when block code finishes. + # the normal cursor timeout behavior of the mongod process. When +false+, the returned cursor will + # never timeout. Note that disabling timeout will only work when #find is invoked with a block. + # This is to prevent any inadvertant failure to close the cursor, as the cursor is explicitly + # closed when block code finishes. # @option opts [Block] :transformer (nil) a block for tranforming returned documents. # This is normally used by object mappers to convert each returned document to an instance of a class. # diff --git a/test/replica_sets/connect_test.rb b/test/replica_sets/connect_test.rb index 0c7ff5c..272374e 100644 --- a/test/replica_sets/connect_test.rb +++ b/test/replica_sets/connect_test.rb @@ -28,7 +28,7 @@ class ConnectTest < Test::Unit::TestCase end def test_connect - @conn = ReplSetConnection.new([RS.host, RS.ports[0]], [RS.host, RS.ports[1]], + @conn = ReplSetConnection.new([RS.host, RS.ports[1]], [RS.host, RS.ports[0]], [RS.host, RS.ports[2]], :name => RS.name) assert @conn.connected? assert @conn.read_primary?