minor: doc updates
This commit is contained in:
parent
d71f7d4e3a
commit
d8fb853d7d
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
This is the 10gen-supported Ruby driver for MongoDB[http://www.mongodb.org].
|
This is the 10gen-supported Ruby driver for MongoDB[http://www.mongodb.org].
|
||||||
|
|
||||||
Here is a quick code sample. See the MongoDB Ruby Tutorial
|
Here's a quick code sample. See the MongoDB Ruby Tutorial
|
||||||
(http://www.mongodb.org/display/DOCS/Ruby+Tutorial) for much more.
|
(http://www.mongodb.org/display/DOCS/Ruby+Tutorial) for much more.
|
||||||
|
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
|
@ -264,7 +264,7 @@ Random cursor fun facts:
|
||||||
= Testing
|
= Testing
|
||||||
|
|
||||||
If you have the source code, you can run the tests. There's a separate rake task for testing with
|
If you have the source code, you can run the tests. There's a separate rake task for testing with
|
||||||
the mongo_ext c extension enabled.
|
the mongo_ext C extension enabled.
|
||||||
|
|
||||||
$ rake test:c
|
$ rake test:c
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,20 @@
|
||||||
# ++
|
# ++
|
||||||
|
|
||||||
module Mongo
|
module Mongo
|
||||||
|
|
||||||
|
# A class representing the BSON MinKey type. MaxKey will always compare greater than
|
||||||
|
# all other BSON types and values.
|
||||||
|
#
|
||||||
|
# @example Sorting (assume @numbers is a collection):
|
||||||
|
#
|
||||||
|
# >> @numbers.save({"n" => Mongo::MaxKey.new})
|
||||||
|
# >> @numbers.save({"n" => 0})
|
||||||
|
# >> @numbers.save({"n" => 5_000_000})
|
||||||
|
# >> @numbers.find.sort("n").to_a
|
||||||
|
# => [{"_id"=>4b5a050c238d3bace2000004, "n"=>0},
|
||||||
|
# {"_id"=>4b5a04e6238d3bace2000002, "n"=>5_000_000},
|
||||||
|
# {"_id"=>4b5a04ea238d3bace2000003, "n"=>#<Mongo::MaxKey:0x1014ef410>},
|
||||||
|
# ]
|
||||||
class MaxKey
|
class MaxKey
|
||||||
|
|
||||||
def ==(obj)
|
def ==(obj)
|
||||||
|
@ -22,6 +36,19 @@ module Mongo
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# A class representing the BSON MinKey type. MinKey will always compare less than
|
||||||
|
# all other BSON types and values.
|
||||||
|
#
|
||||||
|
# @example Sorting (assume @numbers is a collection):
|
||||||
|
#
|
||||||
|
# >> @numbers.save({"n" => Mongo::MinKey.new})
|
||||||
|
# >> @numbers.save({"n" => -1_000_000})
|
||||||
|
# >> @numbers.save({"n" => 1_000_000})
|
||||||
|
# >> @numbers.find.sort("n").to_a
|
||||||
|
# => [{"_id"=>4b5a050c238d3bace2000004, "n"=>#<Mongo::MinKey:0x1014ef410>},
|
||||||
|
# {"_id"=>4b5a04e6238d3bace2000002, "n"=>-1_000_000},
|
||||||
|
# {"_id"=>4b5a04ea238d3bace2000003, "n"=>1_000_000},
|
||||||
|
# ]
|
||||||
class MinKey
|
class MinKey
|
||||||
|
|
||||||
def ==(obj)
|
def ==(obj)
|
||||||
|
|
Loading…
Reference in New Issue