[DOCS-197] ReplSetConnection documentation for Ruby appears to be incorrect Created: 01/May/12  Updated: 02/Nov/16  Resolved: 08/Jun/12

Status: Closed
Project: Documentation
Component/s: drivers
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Niels Meersschaert Assignee: Gary Murakami
Resolution: Done Votes: 0
Labels: ruby
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File Rakefile    
Participants:
Days since reply: 11 years, 36 weeks, 5 days ago

 Description   

http://api.mongodb.org/ruby/current/Mongo/ReplSetConnection.html has the following example of code.

ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :read => :secondary)

I create a local replica set with 2 nodes listening on the ports listed above.

Calling this will fail with a message: Mongo::ConnectionFailure: Cannot connect to a replica set using seeds localhost:30000:localhost:30001

Changing it to Mongo::ReplSetConnection.new(['localhost',30000], ['localhost',30001], :read => :secondary) does work correctly.



 Comments   
Comment by Gary Murakami [ 08/Jun/12 ]

updated docs now have a notation at the top to go to the exact matching version

Comment by Sam Kleinman (Inactive) [ 06/Jun/12 ]

gary, was this resolved as part of the last ruby driver release?

Comment by auto [ 14/May/12 ]

Author:

{u'login': u'gjmurakami-10gen', u'name': u'Gary Murakami', u'email': u'gary.murakami@10gen.com'}

Message: documentation improvements for Yard/Ydoc newbies, also relative links replace absolute links where possible so that the user is left with the exact version and not forced to current web docs, in accordance with DOCS-197
Branch: master
https://github.com/mongodb/mongo-ruby-driver/commit/71650076deb95d949d1267a9cde4cffe8e1624bc

Comment by Gary Murakami [ 09/May/12 ]

I think that adjusting the README file is appropriate for now, however, the actual "fix" will not be on the web until we push out a new point release. We should keep this issue open until then.

Comment by auto [ 04/May/12 ]

Author:

{u'login': u'gjmurakami-10gen', u'name': u'Gary Murakami', u'email': u'gary.murakami@10gen.com'}

Message: Revert cbson.c, to be revisited for malloc/free reduction.
README.md has API Documentation note at the top to help users match documentation to driver version, DOCS-197.
Expanded performance tests, for insert with multiple docs.
Branch: master
https://github.com/mongodb/mongo-ruby-driver/commit/50d6902d80c65d592d75f5cb0c4019de36319efc

Comment by Gary Murakami [ 03/May/12 ]

Niels:

Thanks for the version clarification.

The Ruby Language Center http://www.mongodb.org/display/DOCS/Ruby+Language+Center has a link "API Documentation" that goes directly to
http://api.mongodb.org/ruby/current/index.html
On this API Documentation index page, there's a link to "Documentation" http://api.mongodb.org/ruby/ however I think that this is somewhat buried too far down the page.
I suggest that (at the very least) we move it to the very top with a prominent note about checking the Ruby driver version and explicitly using the matching documentation.

Comments? Niels? Kyle?

Comment by Kyle Banker [ 03/May/12 ]

Niels,

You were linking to the current docs, which is for the current release. Here's the page with all versions:
http://api.mongodb.org/ruby/

Kyle

Comment by Niels Meersschaert [ 02/May/12 ]

Kyle,

In the app where we noticed this it was 1.3.1. Perhaps we can update the docs to show that the string version is only available > version it was added. I saw another set of docs that had the array format version & due to the confusion we started testing both approaches, but found the official docs didn't work with our 1.3.1 version.

Niels

Comment by auto [ 02/May/12 ]

Author:

{u'login': u'gjmurakami-10gen', u'name': u'Gary Murakami', u'email': u'gary.murakami@10gen.com'}

Message: DOCS-197 Fully qualify examples in the code with Mongo::
Branch: master
https://github.com/mongodb/mongo-ruby-driver/commit/ca7bf209ddf1d7955df556602bd2eb704ee22d15

Comment by Kyle Banker [ 02/May/12 ]

Niels:

Which version of the Ruby driver are you running? The host:port string support was only added recently.

Kyle

Comment by Niels Meersschaert [ 02/May/12 ]

Specifically the host:port string vs [host, port] array. The array works, the string does not.

Comment by Gary Murakami [ 02/May/12 ]

Rakefile for easy setup/reset of replica sets with a test for Mongo::ReplSetConnection

Comment by Gary Murakami [ 02/May/12 ]

Yes, the documentation is simply missing "Mongo::" qualifier to the reference to ReplSetConnection, however, other than that, the single array for the members with "host:port" works for me. Would you please clarify if you are commenting about the missing "Mongo::" or about the "host:port" args?

I'll attach a Rakefile that helped in my diagnostics.

Generated at Thu Feb 08 07:38:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.