The following works:
client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :secondary_preferred) client['database']['collection'].find_one() client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :primary) client['database']['collection'].find_one()
However, this does not:
client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :secondary) client['database']['collection'].find_one() => SystemStackError: stack level too deep client = Mongo::MongoShardedClient.new("brandonblack-mbpr.local:3333", :read => :primary_preferred) client['database']['collection'].find_one() => Mongo::OperationFailure: wrong type for field (mode) 14 != 2
- duplicates
-
RUBY-542 MongoShardedClient does not support read preferences correctly
- Closed