mongo 0.17 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +7 -9
- data/lib/mongo.rb +3 -1
- data/lib/mongo/collection.rb +1 -0
- data/lib/mongo/connection.rb +0 -2
- data/lib/mongo/db.rb +1 -1
- data/lib/mongo/util/ordered_hash.rb +1 -0
- data/test/test_collection.rb +23 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -32,6 +32,11 @@ If (or once) you have Gemcutter setup, install the "mongo" gem by typing
|
|
32
32
|
|
33
33
|
$ gem install mongo
|
34
34
|
|
35
|
+
For a significant performance boost, you should also install the driver's C
|
36
|
+
extensions:
|
37
|
+
|
38
|
+
$ gem install mongo_ext
|
39
|
+
|
35
40
|
=== From the GitHub source
|
36
41
|
|
37
42
|
The source code is available at http://github.com/mongodb/mongo-ruby-driver.
|
@@ -41,15 +46,7 @@ you can install it as a gem from the source by typing
|
|
41
46
|
|
42
47
|
$ rake gem:install
|
43
48
|
|
44
|
-
|
45
|
-
|
46
|
-
There is a separate gem containing optional C extensions that will increase the
|
47
|
-
performance of the driver. To use the optional extensions just install the gem
|
48
|
-
by typing
|
49
|
-
|
50
|
-
$ gem install mongo_ext
|
51
|
-
|
52
|
-
To install from source type this instead
|
49
|
+
To install the C extensions from source, type this instead:
|
53
50
|
|
54
51
|
$ rake gem:install_extensions
|
55
52
|
|
@@ -358,6 +355,7 @@ Sean Cribbs, seancribbs on github
|
|
358
355
|
|
359
356
|
Sunny Hirai
|
360
357
|
* Suggested hashcode fix for Mongo::ObjectID
|
358
|
+
* Noted index ordering bug.
|
361
359
|
|
362
360
|
= License
|
363
361
|
|
data/lib/mongo.rb
CHANGED
@@ -23,11 +23,13 @@ begin
|
|
23
23
|
BSON_SERIALIZER = CBson
|
24
24
|
rescue LoadError
|
25
25
|
BSON_SERIALIZER = BSON
|
26
|
+
warn "\n**Notice: C extension not detected. This is required for optimum MongoDB Ruby driver performance."
|
27
|
+
warn " You can install the extension as follows:\n gem install mongo_ext\n"
|
26
28
|
end
|
27
29
|
|
28
30
|
module Mongo
|
29
31
|
ASCENDING = 1
|
30
32
|
DESCENDING = -1
|
31
33
|
|
32
|
-
VERSION = "0.17"
|
34
|
+
VERSION = "0.17.1"
|
33
35
|
end
|
data/lib/mongo/collection.rb
CHANGED
data/lib/mongo/connection.rb
CHANGED
data/lib/mongo/db.rb
CHANGED
@@ -422,7 +422,7 @@ module Mongo
|
|
422
422
|
sel = {:ns => full_collection_name(collection_name)}
|
423
423
|
info = {}
|
424
424
|
Cursor.new(Collection.new(self, SYSTEM_INDEX_COLLECTION), :selector => sel).each { |index|
|
425
|
-
info[index['name']] = index['key'].
|
425
|
+
info[index['name']] = index['key'].map
|
426
426
|
}
|
427
427
|
info
|
428
428
|
end
|
data/test/test_collection.rb
CHANGED
@@ -398,4 +398,27 @@ class TestCollection < Test::Unit::TestCase
|
|
398
398
|
assert_equal 1, @collection.size
|
399
399
|
end
|
400
400
|
end
|
401
|
+
|
402
|
+
context "Creating indexes " do
|
403
|
+
setup do
|
404
|
+
@collection = @@db.collection('test-collection')
|
405
|
+
end
|
406
|
+
|
407
|
+
should "generate indexes in the proper order" do
|
408
|
+
@collection.expects(:insert_documents) do |sel, coll, safe|
|
409
|
+
assert_equal 'b_1_a_1', sel[:name]
|
410
|
+
end
|
411
|
+
@collection.create_index([['b', 1], ['a', 1]])
|
412
|
+
end
|
413
|
+
|
414
|
+
context "with an index created" do
|
415
|
+
setup do
|
416
|
+
@collection.create_index([['b', 1], ['a', 1]])
|
417
|
+
end
|
418
|
+
|
419
|
+
should "return properly ordered index information" do
|
420
|
+
assert_equal [['b', 1], ['a', 1]], @collection.index_information["b_1_a_1"]
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
401
424
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.17.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Menard
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-11-
|
13
|
+
date: 2009-11-17 00:00:00 -05:00
|
14
14
|
default_executable:
|
15
15
|
dependencies: []
|
16
16
|
|