DOCS-197 Fully qualify examples in the code with Mongo::
This commit is contained in:
parent
962c4f2f2e
commit
ca7bf209dd
|
@ -77,16 +77,16 @@ module Mongo
|
||||||
# @option opts [Boolean] :ssl (false) If true, create the connection to the server using SSL.
|
# @option opts [Boolean] :ssl (false) If true, create the connection to the server using SSL.
|
||||||
#
|
#
|
||||||
# @example localhost, 27017
|
# @example localhost, 27017
|
||||||
# Connection.new
|
# Mongo::Connection.new
|
||||||
#
|
#
|
||||||
# @example localhost, 27017
|
# @example localhost, 27017
|
||||||
# Connection.new("localhost")
|
# Mongo::Connection.new("localhost")
|
||||||
#
|
#
|
||||||
# @example localhost, 3000, max 5 self.connections, with max 5 seconds of wait time.
|
# @example localhost, 3000, max 5 self.connections, with max 5 seconds of wait time.
|
||||||
# Connection.new("localhost", 3000, :pool_size => 5, :timeout => 5)
|
# Mongo::Connection.new("localhost", 3000, :pool_size => 5, :timeout => 5)
|
||||||
#
|
#
|
||||||
# @example localhost, 3000, where this node may be a slave
|
# @example localhost, 3000, where this node may be a slave
|
||||||
# Connection.new("localhost", 3000, :slave_ok => true)
|
# Mongo::Connection.new("localhost", 3000, :slave_ok => true)
|
||||||
#
|
#
|
||||||
# @see http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html Replica sets in Ruby
|
# @see http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html Replica sets in Ruby
|
||||||
#
|
#
|
||||||
|
@ -131,10 +131,10 @@ module Mongo
|
||||||
# to send reads to.
|
# to send reads to.
|
||||||
#
|
#
|
||||||
# @example
|
# @example
|
||||||
# Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017]])
|
# Mongo::Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017]])
|
||||||
#
|
#
|
||||||
# @example This connection will read from a random secondary node.
|
# @example This connection will read from a random secondary node.
|
||||||
# Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017], ["db3.example.com", 27017]],
|
# Mongo::Connection.multi([["db1.example.com", 27017], ["db2.example.com", 27017], ["db3.example.com", 27017]],
|
||||||
# :read_secondary => true)
|
# :read_secondary => true)
|
||||||
#
|
#
|
||||||
# @return [Mongo::Connection]
|
# @return [Mongo::Connection]
|
||||||
|
|
|
@ -33,19 +33,19 @@ module Mongo
|
||||||
# @example
|
# @example
|
||||||
#
|
#
|
||||||
# # Check for the existence of a given filename
|
# # Check for the existence of a given filename
|
||||||
# @grid = GridFileSystem.new(@db)
|
# @grid = Mongo::GridFileSystem.new(@db)
|
||||||
# @grid.exist?(:filename => 'foo.txt')
|
# @grid.exist?(:filename => 'foo.txt')
|
||||||
#
|
#
|
||||||
# # Check for existence filename and content type
|
# # Check for existence filename and content type
|
||||||
# @grid = GridFileSystem.new(@db)
|
# @grid = Mongo::GridFileSystem.new(@db)
|
||||||
# @grid.exist?(:filename => 'foo.txt', :content_type => 'image/jpg')
|
# @grid.exist?(:filename => 'foo.txt', :content_type => 'image/jpg')
|
||||||
#
|
#
|
||||||
# # Check for existence by _id
|
# # Check for existence by _id
|
||||||
# @grid = Grid.new(@db)
|
# @grid = Mongo::Grid.new(@db)
|
||||||
# @grid.exist?(:_id => BSON::ObjectId.from_string('4bddcd24beffd95a7db9b8c8'))
|
# @grid.exist?(:_id => BSON::ObjectId.from_string('4bddcd24beffd95a7db9b8c8'))
|
||||||
#
|
#
|
||||||
# # Check for existence by an arbitrary attribute.
|
# # Check for existence by an arbitrary attribute.
|
||||||
# @grid = Grid.new(@db)
|
# @grid = Mongo::Grid.new(@db)
|
||||||
# @grid.exist?(:tags => {'$in' => ['nature', 'zen', 'photography']})
|
# @grid.exist?(:tags => {'$in' => ['nature', 'zen', 'photography']})
|
||||||
#
|
#
|
||||||
# @return [nil, Hash] either nil for the file's metadata as a hash.
|
# @return [nil, Hash] either nil for the file's metadata as a hash.
|
||||||
|
|
|
@ -78,20 +78,20 @@ module Mongo
|
||||||
# @example
|
# @example
|
||||||
#
|
#
|
||||||
# # Store the text "Hello, world!" in the grid file system.
|
# # Store the text "Hello, world!" in the grid file system.
|
||||||
# @grid = GridFileSystem.new(@db)
|
# @grid = Mongo::GridFileSystem.new(@db)
|
||||||
# @grid.open('filename', 'w') do |f|
|
# @grid.open('filename', 'w') do |f|
|
||||||
# f.write "Hello, world!"
|
# f.write "Hello, world!"
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# # Output "Hello, world!"
|
# # Output "Hello, world!"
|
||||||
# @grid = GridFileSystem.new(@db)
|
# @grid = Mongo::GridFileSystem.new(@db)
|
||||||
# @grid.open('filename', 'r') do |f|
|
# @grid.open('filename', 'r') do |f|
|
||||||
# puts f.read
|
# puts f.read
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
# # Write a file on disk to the GridFileSystem
|
# # Write a file on disk to the GridFileSystem
|
||||||
# @file = File.open('image.jpg')
|
# @file = File.open('image.jpg')
|
||||||
# @grid = GridFileSystem.new(@db)
|
# @grid = Mongo::GridFileSystem.new(@db)
|
||||||
# @grid.open('image.jpg, 'w') do |f|
|
# @grid.open('image.jpg, 'w') do |f|
|
||||||
# f.write @file
|
# f.write @file
|
||||||
# end
|
# end
|
||||||
|
|
|
@ -68,13 +68,13 @@ module Mongo
|
||||||
# The purpose of seed nodes is to permit the driver to find at least one replica set member even if a member is down.
|
# The purpose of seed nodes is to permit the driver to find at least one replica set member even if a member is down.
|
||||||
#
|
#
|
||||||
# @example Connect to a replica set and provide two seed nodes.
|
# @example Connect to a replica set and provide two seed nodes.
|
||||||
# ReplSetConnection.new(['localhost:30000', 'localhost:30001'])
|
# Mongo::ReplSetConnection.new(['localhost:30000', 'localhost:30001'])
|
||||||
#
|
#
|
||||||
# @example Connect to a replica set providing two seed nodes and ensuring a connection to the replica set named 'prod':
|
# @example Connect to a replica set providing two seed nodes and ensuring a connection to the replica set named 'prod':
|
||||||
# ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :name => 'prod')
|
# Mongo::ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :name => 'prod')
|
||||||
#
|
#
|
||||||
# @example Connect to a replica set providing two seed nodes and allowing reads from a secondary node:
|
# @example Connect to a replica set providing two seed nodes and allowing reads from a secondary node:
|
||||||
# ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :read => :secondary)
|
# Mongo::ReplSetConnection.new(['localhost:30000', 'localhost:30001'], :read => :secondary)
|
||||||
#
|
#
|
||||||
# @see http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html Replica sets in Ruby
|
# @see http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html Replica sets in Ruby
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue