mongo 1.7.1 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{LICENSE.txt → LICENSE} +0 -0
- data/README.md +124 -111
- data/Rakefile +9 -325
- data/VERSION +1 -0
- data/bin/mongo_console +4 -4
- data/examples/admin.rb +43 -0
- data/examples/capped.rb +22 -0
- data/examples/cursor.rb +48 -0
- data/examples/gridfs.rb +44 -0
- data/examples/index_test.rb +126 -0
- data/examples/info.rb +31 -0
- data/examples/queries.rb +74 -0
- data/examples/replica_set.rb +26 -0
- data/examples/simple.rb +25 -0
- data/examples/strict.rb +35 -0
- data/examples/types.rb +36 -0
- data/{test/load → examples/web}/thin/load.rb +3 -1
- data/{test/load → examples/web}/unicorn/load.rb +5 -3
- data/lib/mongo.rb +8 -10
- data/lib/mongo/collection.rb +134 -114
- data/lib/mongo/cursor.rb +21 -14
- data/lib/mongo/db.rb +30 -28
- data/lib/mongo/exceptions.rb +1 -1
- data/lib/mongo/gridfs/grid.rb +8 -7
- data/lib/mongo/gridfs/grid_ext.rb +1 -1
- data/lib/mongo/gridfs/grid_file_system.rb +6 -5
- data/lib/mongo/gridfs/grid_io.rb +22 -19
- data/lib/mongo/legacy.rb +82 -0
- data/lib/mongo/{connection.rb → mongo_client.rb} +82 -61
- data/lib/mongo/{repl_set_connection.rb → mongo_replica_set_client.rb} +54 -39
- data/lib/mongo/{sharded_connection.rb → mongo_sharded_client.rb} +9 -9
- data/lib/mongo/networking.rb +25 -20
- data/lib/mongo/util/conversions.rb +1 -1
- data/lib/mongo/util/core_ext.rb +1 -1
- data/lib/mongo/util/logging.rb +20 -4
- data/lib/mongo/util/node.rb +16 -16
- data/lib/mongo/util/pool.rb +56 -27
- data/lib/mongo/util/pool_manager.rb +28 -27
- data/lib/mongo/util/server_version.rb +1 -1
- data/lib/mongo/util/sharding_pool_manager.rb +8 -8
- data/lib/mongo/util/ssl_socket.rb +1 -5
- data/lib/mongo/util/support.rb +24 -8
- data/lib/mongo/util/tcp_socket.rb +0 -4
- data/lib/mongo/util/uri_parser.rb +54 -38
- data/lib/mongo/util/write_concern.rb +67 -0
- data/mongo.gemspec +21 -32
- data/test/auxillary/{1.4_features.rb → 1.4_feature_test.rb} +4 -5
- data/test/auxillary/authentication_test.rb +18 -20
- data/test/auxillary/autoreconnect_test.rb +3 -5
- data/test/auxillary/fork_test.rb +5 -7
- data/test/auxillary/repl_set_auth_test.rb +13 -15
- data/test/auxillary/slave_connection_test.rb +8 -7
- data/test/auxillary/threaded_authentication_test.rb +15 -17
- data/test/bson/binary_test.rb +1 -1
- data/test/bson/bson_test.rb +60 -36
- data/test/bson/byte_buffer_test.rb +1 -1
- data/test/bson/hash_with_indifferent_access_test.rb +2 -2
- data/test/bson/json_test.rb +1 -2
- data/test/bson/object_id_test.rb +1 -2
- data/test/bson/ordered_hash_test.rb +1 -1
- data/test/bson/timestamp_test.rb +1 -1
- data/test/{collection_test.rb → functional/collection_test.rb} +57 -57
- data/test/{connection_test.rb → functional/connection_test.rb} +75 -89
- data/test/{conversions_test.rb → functional/conversions_test.rb} +1 -1
- data/test/{cursor_fail_test.rb → functional/cursor_fail_test.rb} +3 -29
- data/test/{cursor_message_test.rb → functional/cursor_message_test.rb} +1 -1
- data/test/{cursor_test.rb → functional/cursor_test.rb} +5 -1
- data/test/{db_api_test.rb → functional/db_api_test.rb} +8 -9
- data/test/{db_connection_test.rb → functional/db_connection_test.rb} +3 -5
- data/test/{db_test.rb → functional/db_test.rb} +13 -13
- data/test/{grid_file_system_test.rb → functional/grid_file_system_test.rb} +2 -2
- data/test/{grid_io_test.rb → functional/grid_io_test.rb} +6 -6
- data/test/{grid_test.rb → functional/grid_test.rb} +4 -10
- data/test/{pool_test.rb → functional/pool_test.rb} +1 -1
- data/test/functional/safe_test.rb +84 -0
- data/test/{support_test.rb → functional/support_test.rb} +1 -1
- data/test/{threading_test.rb → functional/threading_test.rb} +9 -9
- data/test/{timeout_test.rb → functional/timeout_test.rb} +1 -1
- data/test/{uri_test.rb → functional/uri_test.rb} +1 -1
- data/test/functional/write_concern_test.rb +104 -0
- data/test/replica_set/basic_test.rb +139 -0
- data/test/replica_set/client_test.rb +255 -0
- data/test/replica_set/complex_connect_test.rb +62 -0
- data/test/replica_set/connection_test.rb +255 -0
- data/test/{replica_sets → replica_set}/count_test.rb +17 -14
- data/test/replica_set/cursor_test.rb +75 -0
- data/test/{replica_sets → replica_set}/insert_test.rb +19 -16
- data/test/replica_set/query_test.rb +64 -0
- data/test/replica_set/refresh_test.rb +153 -0
- data/test/{replica_sets → replica_set}/replication_ack_test.rb +21 -17
- data/test/sharded_cluster/basic_test.rb +31 -50
- data/test/support/hash_with_indifferent_access.rb +1 -1
- data/test/test_helper.rb +56 -9
- data/test/threading/threading_with_large_pool_test.rb +8 -8
- data/test/tools/mongo_config.rb +270 -58
- data/test/tools/mongo_config_test.rb +146 -0
- data/test/unit/client_test.rb +230 -0
- data/test/unit/collection_test.rb +45 -32
- data/test/unit/connection_test.rb +82 -74
- data/test/unit/cursor_test.rb +14 -6
- data/test/unit/db_test.rb +8 -8
- data/test/unit/grid_test.rb +11 -11
- data/test/unit/node_test.rb +24 -24
- data/test/unit/pool_manager_test.rb +13 -13
- data/test/unit/pool_test.rb +1 -1
- data/test/unit/read_test.rb +21 -26
- data/test/unit/safe_test.rb +52 -33
- data/test/unit/util_test.rb +55 -0
- data/test/unit/write_concern_test.rb +161 -0
- metadata +158 -171
- data/docs/CREDITS.md +0 -123
- data/docs/FAQ.md +0 -116
- data/docs/GRID_FS.md +0 -158
- data/docs/HISTORY.md +0 -392
- data/docs/READ_PREFERENCE.md +0 -99
- data/docs/RELEASES.md +0 -54
- data/docs/REPLICA_SETS.md +0 -113
- data/docs/TAILABLE_CURSORS.md +0 -51
- data/docs/TUTORIAL.md +0 -356
- data/docs/WRITE_CONCERN.md +0 -31
- data/lib/mongo/gridfs/grid_io_fix.rb +0 -38
- data/lib/mongo/version.rb +0 -3
- data/test/bson/test_helper.rb +0 -30
- data/test/replica_sets/basic_test.rb +0 -119
- data/test/replica_sets/complex_connect_test.rb +0 -57
- data/test/replica_sets/complex_read_preference_test.rb +0 -237
- data/test/replica_sets/connect_test.rb +0 -156
- data/test/replica_sets/cursor_test.rb +0 -70
- data/test/replica_sets/pooled_insert_test.rb +0 -57
- data/test/replica_sets/query_test.rb +0 -50
- data/test/replica_sets/read_preference_test.rb +0 -234
- data/test/replica_sets/refresh_test.rb +0 -156
- data/test/replica_sets/refresh_with_threads_test.rb +0 -60
- data/test/replica_sets/rs_test_helper.rb +0 -39
- data/test/safe_test.rb +0 -68
- data/test/sharded_cluster/mongo_config_test.rb +0 -126
- data/test/sharded_cluster/sc_test_helper.rb +0 -39
- data/test/tools/repl_set_manager.rb +0 -418
data/docs/FAQ.md
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
# Ruby MongoDB FAQ
|
2
|
-
|
3
|
-
This is a list of frequently asked questions about using Ruby with MongoDB. If you have a question you'd like to have answered here, please post your question to the [mongodb-user list](http://groups.google.com/group/mongodb-user).
|
4
|
-
|
5
|
-
#### Can I run (insert command name here) from the Ruby driver?
|
6
|
-
|
7
|
-
Yes. You can run any of the [available database commands|List of Database Commands] from the driver using the DB#command method. The only trick is to use an OrderedHash when specifying the command. For example, here's how you'd run an asynchronous fsync from the driver:
|
8
|
-
|
9
|
-
|
10
|
-
# This command is run on the admin database.
|
11
|
-
@db = Mongo::Connection.new.db('admin')
|
12
|
-
|
13
|
-
# Build the command.
|
14
|
-
cmd = OrderedHash.new
|
15
|
-
cmd['fsync'] = 1
|
16
|
-
cmd['async'] = true
|
17
|
-
|
18
|
-
# Run it.
|
19
|
-
@db.command(cmd)
|
20
|
-
|
21
|
-
|
22
|
-
It's important to keep in mind that some commands, like `fsync`, must be run on the `admin` database, while other commands can be run on any database. If you're having trouble, check the [command reference|List of Database Commands] to make sure you're using the command correctly.
|
23
|
-
|
24
|
-
#### Does the Ruby driver support an EXPLAIN command?
|
25
|
-
|
26
|
-
Yes. `explain` is, technically speaking, an option sent to a query that tells MongoDB to return an explain plan rather than the query's results. You can use `explain` by constructing a query and calling explain at the end:
|
27
|
-
|
28
|
-
|
29
|
-
@collection = @db['users']
|
30
|
-
result = @collection.find({:name => "jones"}).explain
|
31
|
-
|
32
|
-
|
33
|
-
The resulting explain plan might look something like this:
|
34
|
-
|
35
|
-
|
36
|
-
{"cursor"=>"BtreeCursor name_1",
|
37
|
-
"startKey"=>{"name"=>"Jones"},
|
38
|
-
"endKey"=>{"name"=>"Jones"},
|
39
|
-
"nscanned"=>1.0,
|
40
|
-
"n"=>1,
|
41
|
-
"millis"=>0,
|
42
|
-
"oldPlan"=>{"cursor"=>"BtreeCursor name_1",
|
43
|
-
"startKey"=>{"name"=>"Jones"},
|
44
|
-
"endKey"=>{"name"=>"Jones"}
|
45
|
-
},
|
46
|
-
"allPlans"=>[{"cursor"=>"BtreeCursor name_1",
|
47
|
-
"startKey"=>{"name"=>"Jones"},
|
48
|
-
"endKey"=>{"name"=>"Jones"`]
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
Because this collection has an index on the "name" field, the query uses that index, only having to scan a single record. "n" is the number of records the query will return. "millis" is the time the query takes, in milliseconds. "oldPlan" indicates that the query optimizer has already seen this kind of query and has, therefore, saved an efficient query plan. "allPlans" shows all the plans considered for this query.
|
53
|
-
|
54
|
-
#### I see that BSON supports a symbol type. Does this mean that I can store Ruby symbols in MongoDB?
|
55
|
-
|
56
|
-
You can store Ruby symbols in MongoDB, but only as values. BSON specifies that document keys must be strings. So, for instance, you can do this:
|
57
|
-
|
58
|
-
|
59
|
-
@collection = @db['test']
|
60
|
-
|
61
|
-
boat_id = @collection.save({:vehicle => :boat})
|
62
|
-
car_id = @collection.save({"vehicle" => "car"})
|
63
|
-
|
64
|
-
@collection.find_one('_id' => boat_id)
|
65
|
-
{"_id" => ObjectID('4bb372a8238d3b5c8c000001'), "vehicle" => :boat}
|
66
|
-
|
67
|
-
|
68
|
-
@collection.find_one('_id' => car_id)
|
69
|
-
{"_id" => ObjectID('4bb372a8238d3b5c8c000002'), "vehicle" => "car"}
|
70
|
-
|
71
|
-
|
72
|
-
Notice that the symbol values are returned as expected, but that symbol keys are treated as strings.
|
73
|
-
|
74
|
-
#### Why can't I access random elements within a cursor?
|
75
|
-
|
76
|
-
MongoDB cursors are designed for sequentially iterating over a result set, and all the drivers, including the Ruby driver, stick closely to this directive. Internally, a Ruby cursor fetches results in batches by running a MongoDB `getmore` operation. The results are buffered for efficient iteration on the client-side.
|
77
|
-
|
78
|
-
What this means is that a cursor is nothing more than a device for returning a result set on a query that's been initiated on the server. Cursors are not containers for result sets. If we allow a cursor to be randomly accessed, then we run into issues regarding the freshness of the data. For instance, if I iterate over a cursor and then want to retrieve the cursor's first element, should a stored copy be returned, or should the cursor re-run the query? If we returned a stored copy, it may not be fresh. And if the the query is re-run, then we're technically dealing with a new cursor.
|
79
|
-
|
80
|
-
To avoid those issues, we're saying that anyone who needs flexible access to the results of a query should store those results in an array and then access the data as needed.
|
81
|
-
|
82
|
-
#### Why can't I save an instance of TimeWithZone?
|
83
|
-
|
84
|
-
MongoDB stores times in UTC as the number of milliseconds since the epoch. This means that the Ruby driver serializes Ruby Time objects only. While it would certainly be possible to serialize a TimeWithZone, this isn't preferable since the driver would still deserialize to a Time object.
|
85
|
-
|
86
|
-
All that said, if necessary, it'd be easy to write a thin wrapper over the driver that would store an extra time zone attribute and handle the serialization/deserialization of TimeWithZone transparently.
|
87
|
-
|
88
|
-
#### I keep getting CURSOR_NOT_FOUND exceptions. What's happening?
|
89
|
-
|
90
|
-
The most likely culprit here is that the cursor is timing out on the server. Whenever you issue a query, a cursor is created on the server. Cursor naturally time out after ten minutes, which means that if you happen to be iterating over a cursor for more than ten minutes, you risk a CURSOR_NOT_FOUND exception.
|
91
|
-
|
92
|
-
There are two solutions to this problem. You can either:
|
93
|
-
|
94
|
-
1. Limit your query. Use some combination of `limit` and `skip` to reduce the total number of query results. This will, obviously, bring down the time it takes to iterate.
|
95
|
-
|
96
|
-
2. Turn off the cursor timeout. To do that, invoke `find` with a block, and pass `:timeout => true`:
|
97
|
-
|
98
|
-
@collection.find({}, :timeout => false) do |cursor|
|
99
|
-
cursor.each do |document
|
100
|
-
# Process documents here
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
#### I periodically see connection failures between the driver and MongoDB. Why can't the driver retry the operation automatically?
|
105
|
-
|
106
|
-
A connection failure can indicate any number of failure scenarios. Has the server crashed? Are we experiencing a temporary network partition? Is there a bug in our ssh tunnel?
|
107
|
-
|
108
|
-
Without further investigation, it's impossible to know exactly what has caused the connection failure. Furthermore, when we do see a connection failure, it's impossible to know how many operations prior to the failure succeeded. Imagine, for instance, that we're using safe mode and we send an `$inc` operation to the server. It's entirely possible that the server has received the `$inc` but failed on the call to `getLastError`. In that case, retrying the operation would result in a double-increment.
|
109
|
-
|
110
|
-
Because of the indeterminacy involved, the MongoDB drivers will not retry operations on connection failure. How connection failures should be handled is entirely dependent on the application. Therefore, we leave it to the application developers to make the best decision in this case.
|
111
|
-
|
112
|
-
The drivers will reconnect on the subsequent operation.
|
113
|
-
|
114
|
-
#### I ocassionally get an error saying that responses are out of order. What's happening?
|
115
|
-
|
116
|
-
See (this JIRA issue)[http://jira.mongodb.org/browse/RUBY-221].
|
data/docs/GRID_FS.md
DELETED
@@ -1,158 +0,0 @@
|
|
1
|
-
# GridFS in Ruby
|
2
|
-
|
3
|
-
GridFS, which stands for "Grid File Store," is a specification for storing large files in MongoDB. It works by dividing a file into manageable chunks and storing each of those chunks as a separate document. GridFS requires two collections to achieve this: one collection stores each file's metadata (e.g., name, size, etc.) and another stores the chunks themselves. If you're interested in more details, check out the [GridFS Specification](http://www.mongodb.org/display/DOCS/GridFS+Specification).
|
4
|
-
|
5
|
-
### The Grid class
|
6
|
-
|
7
|
-
The [Grid class](Mongo/Grid.html) represents the core GridFS implementation. Grid gives you a simple file store, keyed on a unique ID. This means that duplicate filenames aren't a problem. To use the Grid class, first make sure you have a database, and then instantiate a Grid:
|
8
|
-
|
9
|
-
|
10
|
-
@db = Mongo::Connection.new.db('social_site')
|
11
|
-
@grid = Grid.new(@db)
|
12
|
-
|
13
|
-
#### Saving files
|
14
|
-
Once you have a Grid object, you can start saving data to it. The data can be either a string or an IO-like object that responds to a #read method:
|
15
|
-
|
16
|
-
|
17
|
-
# Saving string data
|
18
|
-
id = @grid.put("here's some string / binary data")
|
19
|
-
|
20
|
-
# Saving IO data and including the optional filename
|
21
|
-
image = File.open("me.jpg")
|
22
|
-
id2 = @grid.put(image, :filename => "me.jpg")
|
23
|
-
|
24
|
-
|
25
|
-
Grid#put returns an object id, which you can use to retrieve the file:
|
26
|
-
|
27
|
-
|
28
|
-
# Get the string we saved
|
29
|
-
file = @grid.get(id)
|
30
|
-
|
31
|
-
# Get the file we saved
|
32
|
-
image = @grid.get(id2)
|
33
|
-
|
34
|
-
|
35
|
-
#### File metadata
|
36
|
-
|
37
|
-
There are accessors for the various file attributes:
|
38
|
-
|
39
|
-
|
40
|
-
image.filename
|
41
|
-
# => "me.jpg"
|
42
|
-
|
43
|
-
image.content_type
|
44
|
-
# => "image/jpg"
|
45
|
-
|
46
|
-
image.file_length
|
47
|
-
# => 502357
|
48
|
-
|
49
|
-
image.upload_date
|
50
|
-
# => Mon Mar 01 16:18:30 UTC 2010
|
51
|
-
|
52
|
-
# Read all the image's data at once
|
53
|
-
image.read
|
54
|
-
|
55
|
-
# Read the first 100k bytes of the image
|
56
|
-
image.read(100 * 1024)
|
57
|
-
|
58
|
-
|
59
|
-
When putting a file, you can set many of these attributes and write arbitrary metadata:
|
60
|
-
|
61
|
-
|
62
|
-
# Saving IO data
|
63
|
-
file = File.open("me.jpg")
|
64
|
-
id2 = @grid.put(file,
|
65
|
-
:filename => "my-avatar.jpg"
|
66
|
-
:content_type => "application/jpg",
|
67
|
-
:_id => 'a-unique-id-to-use-in-lieu-of-a-random-one',
|
68
|
-
:chunk_size => 100 * 1024,
|
69
|
-
:metadata => {'description' => "taken after a game of ultimate"})
|
70
|
-
|
71
|
-
|
72
|
-
#### Safe mode
|
73
|
-
|
74
|
-
A kind of safe mode is built into the GridFS specification. When you save a file, and MD5 hash is created on the server. If you save the file in safe mode, an MD5 will be created on the client for comparison with the server version. If the two hashes don't match, an exception will be raised.
|
75
|
-
|
76
|
-
|
77
|
-
image = File.open("me.jpg")
|
78
|
-
id2 = @grid.put(image, "my-avatar.jpg", :safe => true)
|
79
|
-
|
80
|
-
|
81
|
-
#### Deleting files
|
82
|
-
|
83
|
-
Deleting a file is as simple as providing the id:
|
84
|
-
|
85
|
-
|
86
|
-
@grid.delete(id2)
|
87
|
-
|
88
|
-
|
89
|
-
### The GridFileSystem class
|
90
|
-
|
91
|
-
[GridFileSystem](Mongo/GridFileSystem.html) is a light emulation of a file system and therefore has a couple of unique properties. The first is that filenames are assumed to be unique. The second, a consequence of the first, is that files are versioned. To see what this means, let's create a GridFileSystem instance:
|
92
|
-
|
93
|
-
#### Saving files
|
94
|
-
|
95
|
-
@db = Mongo::Connection.new.db("social_site")
|
96
|
-
@fs = GridFileSystem.new(@db)
|
97
|
-
|
98
|
-
Now suppose we want to save the file 'me.jpg.' This is easily done using a filesystem-like API:
|
99
|
-
|
100
|
-
|
101
|
-
image = File.open("me.jpg")
|
102
|
-
@fs.open("me.jpg", "w") do |f|
|
103
|
-
f.write image
|
104
|
-
end
|
105
|
-
|
106
|
-
|
107
|
-
We can then retrieve the file by filename:
|
108
|
-
|
109
|
-
|
110
|
-
image = @fs.open("me.jpg", "r") {|f| f.read }
|
111
|
-
|
112
|
-
|
113
|
-
No problems there. But what if we need to replace the file? That too is straightforward:
|
114
|
-
|
115
|
-
|
116
|
-
image = File.open("me-dancing.jpg")
|
117
|
-
@fs.open("me.jpg", "w") do |f|
|
118
|
-
f.write image
|
119
|
-
end
|
120
|
-
|
121
|
-
|
122
|
-
But a couple things need to be kept in mind. First is that the original 'me.jpg' will be available until the new 'me.jpg' saves. From then on, calls to the #open method will always return the most recently saved version of a file. But, and this the second point, old versions of the file won't be deleted. So if you're going to be rewriting files often, you could end up with a lot of old versions piling up. One solution to this is to use the :delete_old options when writing a file:
|
123
|
-
|
124
|
-
|
125
|
-
image = File.open("me-dancing.jpg")
|
126
|
-
@fs.open("me.jpg", "w", :delete_old => true) do |f|
|
127
|
-
f.write image
|
128
|
-
end
|
129
|
-
|
130
|
-
|
131
|
-
This will delete all but the latest version of the file.
|
132
|
-
|
133
|
-
|
134
|
-
#### Deleting files
|
135
|
-
|
136
|
-
When you delete a file by name, you delete all versions of that file:
|
137
|
-
|
138
|
-
|
139
|
-
@fs.delete("me.jpg")
|
140
|
-
|
141
|
-
|
142
|
-
#### Metadata and safe mode
|
143
|
-
|
144
|
-
All of the options for storing metadata and saving in safe mode are available for the GridFileSystem class:
|
145
|
-
|
146
|
-
|
147
|
-
image = File.open("me.jpg")
|
148
|
-
@fs.open('my-avatar.jpg', w,
|
149
|
-
:content_type => "application/jpg",
|
150
|
-
:metadata => {'description' => "taken on 3/1/2010 after a game of ultimate"},
|
151
|
-
:_id => 'a-unique-id-to-use-instead-of-the-automatically-generated-one',
|
152
|
-
:safe => true) { |f| f.write image }
|
153
|
-
|
154
|
-
|
155
|
-
### Advanced Users
|
156
|
-
|
157
|
-
Astute code readers will notice that the Grid and GridFileSystem classes are merely thin wrappers around an underlying [GridIO class](Mongo/GridIO.html). This means that it's easy to customize the GridFS implementation presented here; just use GridIO for all the low-level work, and build the API you need in an external manager class similar to Grid or GridFileSystem.
|
158
|
-
|
data/docs/HISTORY.md
DELETED
@@ -1,392 +0,0 @@
|
|
1
|
-
# MongoDB Ruby Driver History
|
2
|
-
|
3
|
-
### 1.7.0
|
4
|
-
2012-08-20
|
5
|
-
|
6
|
-
* Added testing and full support for MongoDB 2.1 & 2.2
|
7
|
-
* Added Aggregation Framework helper method
|
8
|
-
* Added support for Mongos high availability
|
9
|
-
* Modified and added new read preferences (details in documentation)
|
10
|
-
* Added support for data center awareness (tag_sets)
|
11
|
-
* Fixed bug which attempted to close cursors on wrong replica set member
|
12
|
-
|
13
|
-
### 1.6.4
|
14
|
-
2012-06-06
|
15
|
-
|
16
|
-
* Added ability to declare sort ordering via an ordered hash
|
17
|
-
* Addresses major compatability issue with mongoid created by v1.6.3
|
18
|
-
|
19
|
-
### 1.6.3
|
20
|
-
2012-06-05
|
21
|
-
|
22
|
-
* Performance measurements and enhancements (especially for C-extensions)
|
23
|
-
* Bug fixes for checking strings with non UTF-8 forced or implied encodings
|
24
|
-
* Added refresh support for multiple threaded instances of ReplSetConnection
|
25
|
-
* Added ability to handle IRB::Abort Exception (ctrl-c) cleanly
|
26
|
-
* Added support for large dates on 32-bit platforms (Ruby 1.9+)
|
27
|
-
* Added #to_ary method for BSON::ObjectId (Farrel Lifson)
|
28
|
-
* Added support for ENV['MONGODB_URI'] (Seamus Abshere)
|
29
|
-
* Various gridio bug fixes (John Bintz)
|
30
|
-
* Various logging support improvements
|
31
|
-
* Various documentation improvements (tutorials, sorting, links)
|
32
|
-
|
33
|
-
### 1.6.2
|
34
|
-
2012-04-05
|
35
|
-
|
36
|
-
* Implements socket timeouts via non-blocking IO instead of Timeout module
|
37
|
-
which should greatly increase performance in highly threaded applications
|
38
|
-
* Added ability to authentication via secondary if primary node unavailable
|
39
|
-
* Replica set refresh interval now enforces a lower bound of 60 seconds
|
40
|
-
* Added documentation for dropping indexes, collections, databases
|
41
|
-
* Test output cleanup (...)s unless failure occurs
|
42
|
-
|
43
|
-
### 1.6.1
|
44
|
-
2012-03-07
|
45
|
-
|
46
|
-
* Added thread affinity to Mongo::Pool
|
47
|
-
* Added deploy tasks
|
48
|
-
* Added Travis CI support (Cyril Mougel)
|
49
|
-
* Logging warning message is only displayed for level :debug
|
50
|
-
|
51
|
-
### 1.6.0
|
52
|
-
2012-02-22
|
53
|
-
|
54
|
-
* Added Gemfile
|
55
|
-
* ReplSetConnection seed format is now array of 'host:port' strings
|
56
|
-
* Added read preference :secondary_only
|
57
|
-
* Added ability to log duration -- enabled by default (Cyril Mougel)
|
58
|
-
* Added read_only option for DB#add_user (Ariel Salomon)
|
59
|
-
* Added :collect_on_error option for bulk-insert (Masahiro Nakagawa)
|
60
|
-
* Added and updated URI options (now case insensitive)
|
61
|
-
* Bug fix for ReplSet refresh attempting to close a closed socket
|
62
|
-
* Default op_timeout for ReplSetConnection is now disabled (was 30 seconds)
|
63
|
-
* Support db output option for map reduce (John Ewart)
|
64
|
-
* Support for keeping limited versions of files using GridFS (VvanGemert)
|
65
|
-
|
66
|
-
### 1.5.2
|
67
|
-
2011-12-13
|
68
|
-
|
69
|
-
* Lots of fixes for replica set connection edge cases.
|
70
|
-
* Set default op_timeout and connect_timeout to 30 seconds.
|
71
|
-
* Support GeoHaystack indexing.
|
72
|
-
|
73
|
-
### 1.5.1
|
74
|
-
2011-11-29
|
75
|
-
|
76
|
-
Release due to corrupted gemspec. This was a bug having
|
77
|
-
to do with rubygems. Apparently, gems must still be
|
78
|
-
built with Ruby 1.8.
|
79
|
-
|
80
|
-
### 1.5.0
|
81
|
-
2011-11-28
|
82
|
-
|
83
|
-
This releases fixes bugs introduced in 1.4.0 and 1.4.1 that
|
84
|
-
were introduced as a result of adding replica set refresh modes.
|
85
|
-
|
86
|
-
* Removed :async refresh mode.
|
87
|
-
* Disabled auto refresh mode by default. If you want the driver
|
88
|
-
to automatically check the state of the replica set, you must
|
89
|
-
use :sync mode. Note that replica set refresh is designed only to
|
90
|
-
account for benign changes to the replica set (adding and removing
|
91
|
-
nodes that don't affect current connections).
|
92
|
-
* Fixed bug with commands being sent to secondary nodes. The next
|
93
|
-
release will allow you to specify where commands can be sent.
|
94
|
-
* Support :j safe mode option.
|
95
|
-
* Fix :max_scan and :show_disk_loc Cursor options.
|
96
|
-
|
97
|
-
You can see the remaining issues at https://jira.mongodb.org/secure/ReleaseNote.jspa?projectId=10005&version=10992
|
98
|
-
|
99
|
-
### 1.5.0.rc0
|
100
|
-
2011-11-18
|
101
|
-
|
102
|
-
Fix bugs associated with replica set refresh.
|
103
|
-
|
104
|
-
### 1.4.1
|
105
|
-
2011-10-17
|
106
|
-
|
107
|
-
If you're using 1.4.0, this is a necessary upgrade.
|
108
|
-
|
109
|
-
* Simplified replica set refresh.
|
110
|
-
* Fix bugs associated with replica set refresh.
|
111
|
-
* Make cursor smart enough to continue functioning
|
112
|
-
even if a refresh is triggered.
|
113
|
-
|
114
|
-
### 1.4.0
|
115
|
-
2011-9-19
|
116
|
-
|
117
|
-
* Attempt to automatically refresh internal replica set state using ReplSetConnection#refresh.
|
118
|
-
* Two automated refresh modes: :async and :sync. Automated refresh can also be disabled.
|
119
|
-
* Choose secondary for reads based on ping time.
|
120
|
-
* Read preference API: specify whether queries should go to primary or secondary on a per-query basis.
|
121
|
-
* Pass :require_primary => false to ReplSetConnection to connect without requiring a primary node.
|
122
|
-
* Enable exhaust-mode queries with OP_QUERY_EXHAUST.
|
123
|
-
* Collection#count takes a query selector.
|
124
|
-
* Support continue_on_error flag for bulk inserts (use :continue_on_error => true)
|
125
|
-
* Add Cursor#add_option. Deprecate Cursor#query_opts and replace with Cursor#options.
|
126
|
-
* Initial SSL support (connect with :ssl => true)
|
127
|
-
* Update to latest Java driver for JRuby.
|
128
|
-
* Check max BSON size on a per-connection basis.
|
129
|
-
* Fixed two platform-specific BSON serialization issues.
|
130
|
-
* Lots of bug fixes and code cleanup.
|
131
|
-
|
132
|
-
### 1.3.1
|
133
|
-
2011-5-10
|
134
|
-
|
135
|
-
* Fix GridIO#gets infinite loop error (Ryan McGeary)
|
136
|
-
* Fix BSON::OrderedHash#reject! leaving keys with null values (rpt. by Ben Poweski)
|
137
|
-
* Minor semantic fix for OrderedHash#reject!
|
138
|
-
* Fix Mongo::DB to allow symbols in method traversing collection names (rpt. by Chris Griego)
|
139
|
-
* Support new server regex option "s" (dotall). This is folded in with \m in Ruby.
|
140
|
-
* Fix so that Cursor#close hits the right node when :read_secondary is enabled.
|
141
|
-
* Support maxScan, showDiskLoc, and returnKey cursor options.
|
142
|
-
* Make DB#validate_collection compatible with server v1.9.1.
|
143
|
-
* Fix so that GridIO#gets returns local md5 with md5 matches server md5 (Steve Tantra).
|
144
|
-
* Fix bug in BSON::OrderedHash that prevents YAML.load (Ian Warshak).
|
145
|
-
* Fix example from /examples.
|
146
|
-
* Ensure that we do not modify hash arguments by calling Hash#dup when appropriate.
|
147
|
-
* Ensure that JRuby deserializer preserves binary subtypes properly.
|
148
|
-
* Fix for streaming an empty file into GridFS (Daniël van de Burgt).
|
149
|
-
* Minor doc fixes.
|
150
|
-
|
151
|
-
### 1.3.0
|
152
|
-
2011-4-04
|
153
|
-
|
154
|
-
* Add option to set timeouts on socket read calls using the
|
155
|
-
Mongo::Connection :op_timeout option.
|
156
|
-
* Add StringIO methods to GridIO objects
|
157
|
-
* Support for BSON timestamp type with BSON::Timestamp
|
158
|
-
* Change the BSON binary subtype from 2 to 0
|
159
|
-
* Remove private method Connection#reset_conection
|
160
|
-
and deprecate public method ReplSetConnection#reset_connection
|
161
|
-
* ByteBuffer#== and OrderedHash#dup (Hongli Lai)
|
162
|
-
* Better check for UTF8 validity in Ruby 1.9
|
163
|
-
* Added previously removed Connection#host and Connection#port
|
164
|
-
* Added transformers to allow Mongo::Cursor to allow instantiated objects (John Nunemaker)
|
165
|
-
* Automated reconnection on fork
|
166
|
-
* Added Cursor#next alias for Cursor#next_document
|
167
|
-
* Audit tests after enabling warnings (Wojciech Piekutowski)
|
168
|
-
* Various bug fixes thanks to Datanoise, Hongli Lai, and Mauro Pompilio
|
169
|
-
|
170
|
-
### 1.2.4
|
171
|
-
2011-2-23
|
172
|
-
|
173
|
-
* Fix the exception message shown when there's an IOError (Mauro Pompilio)
|
174
|
-
* Another update to map-reduce docs for v1.8. Note that if you use the new
|
175
|
-
output option `{:out => {:inline => true}}`, then you must also specify
|
176
|
-
`:raw => true`.
|
177
|
-
|
178
|
-
### 1.2.3
|
179
|
-
2011-2-22
|
180
|
-
|
181
|
-
* Update docs for map-reduce command
|
182
|
-
* Minor doc fix
|
183
|
-
|
184
|
-
### 1.2.2
|
185
|
-
2011-2-15
|
186
|
-
|
187
|
-
* Improved replica set failover for edge case.
|
188
|
-
* Fix for REE on OSX (Hongli Lai)
|
189
|
-
|
190
|
-
### 1.2.1
|
191
|
-
2011-1-18
|
192
|
-
|
193
|
-
* Enable authentication with connection pooling.
|
194
|
-
* Allow custom logging with Connection#instrument (CodeMonkeySteve)
|
195
|
-
* Minor fixes and doc improvements.
|
196
|
-
|
197
|
-
### 1.2.0
|
198
|
-
2011-1-18
|
199
|
-
|
200
|
-
* Some minor improvements. See commit history.
|
201
|
-
|
202
|
-
### 1.2.rc0
|
203
|
-
2011-1-5
|
204
|
-
|
205
|
-
Lots of cleanup and minor bug fixes.
|
206
|
-
* Issues resolved: http://jira.mongodb.org/browse/RUBY/fixforversion/10222
|
207
|
-
* Updated Java BSON to Java driver 2.4.
|
208
|
-
* Platform gem for JRuby bson.
|
209
|
-
|
210
|
-
### 1.1.5
|
211
|
-
2010-12-15
|
212
|
-
|
213
|
-
* ReplSetConnection class. This must be used for replica set connections from
|
214
|
-
now on. You can still use Connection.multi, but that method has been deprecated.
|
215
|
-
* Automated replica set tests. rake test:rs
|
216
|
-
* Check that request and response ids match.
|
217
|
-
* Several bug fixes. See the commit history for details.
|
218
|
-
|
219
|
-
### 1.1.4
|
220
|
-
2010-11-30
|
221
|
-
|
222
|
-
* Important connection failure fix.
|
223
|
-
* ObjectId#to_s optimization (David Cuadrado).
|
224
|
-
|
225
|
-
### 1.1.3
|
226
|
-
2010-11-29
|
227
|
-
|
228
|
-
* Distributed reads for replica set secondaries. See /docs/examples/replica_set.rb and
|
229
|
-
http://api.mongodb.org/ruby/current/file.REPLICA_SETS.html for details.
|
230
|
-
* Note: when connecting to a replica set, you must use Connection#multi.
|
231
|
-
* Cursor#count takes optional skip and limit
|
232
|
-
* Collection#ensure_index for caching index creation calls
|
233
|
-
* Collection#update and Collection#remove now return error object when using safe mode
|
234
|
-
* Important fix for int/long serialization on bug introduced in 1.0.9
|
235
|
-
* Numerous tweaks and bug fixes.
|
236
|
-
|
237
|
-
### 1.1.2
|
238
|
-
2010-11-4
|
239
|
-
|
240
|
-
* Two critical fixes to automated failover and replica sets.
|
241
|
-
* Bug passing :timeout to Cursor.
|
242
|
-
* Permit safe mode specification on Connection, Collection, and DB levels.
|
243
|
-
* Specify replica set name on connect to verify connection to the right set.
|
244
|
-
* Misc. reorganization of project and docs.
|
245
|
-
|
246
|
-
### 1.1.1
|
247
|
-
2010-10-14
|
248
|
-
|
249
|
-
* Several critical JRuby bug fixes
|
250
|
-
* Fixes for JRuby in 1.9 mode
|
251
|
-
* Check keys and move id only when necessary for JRuby encoder
|
252
|
-
|
253
|
-
## 1.1
|
254
|
-
2010-10-4
|
255
|
-
|
256
|
-
* Official JRuby support via Java extensons for BSON (beta)
|
257
|
-
* Connection#lock! and Connection#unlock! for easy fsync lock
|
258
|
-
* Note: BSON::Code is no longer a subclass of String.
|
259
|
-
|
260
|
-
### 1.0.9
|
261
|
-
2010-9-20
|
262
|
-
|
263
|
-
* Significant performance improvements (with a lot of help from Hongli Lai)
|
264
|
-
|
265
|
-
### 1.0.8
|
266
|
-
2010-8-27
|
267
|
-
|
268
|
-
* Cursor#rewind! and more consistent Cursor Enumberable behavior
|
269
|
-
* Deprecated ObjectID for ObjectId
|
270
|
-
* Numerous minor bug fixes.
|
271
|
-
|
272
|
-
### 1.0.7
|
273
|
-
2010-8-4
|
274
|
-
|
275
|
-
* A few minor test/doc fixes.
|
276
|
-
* Better tests for replica sets and replication acknowledgment.
|
277
|
-
* Deprecated DB#error and DB#last_status
|
278
|
-
|
279
|
-
### 1.0.6
|
280
|
-
2010-7-26
|
281
|
-
|
282
|
-
* Replica set support.
|
283
|
-
* Collection#map_reduce bug fix.
|
284
|
-
|
285
|
-
### 1.0.5
|
286
|
-
2010-7-13
|
287
|
-
|
288
|
-
* Fix for bug introduced in 1.0.4.
|
289
|
-
|
290
|
-
### 1.0.4
|
291
|
-
2010-7-13
|
292
|
-
|
293
|
-
* Removed deprecated
|
294
|
-
* Cursor admin option
|
295
|
-
* DB#query
|
296
|
-
* DB#create_index (use Collection#create_index)
|
297
|
-
* DB#command only takes hash options now
|
298
|
-
* j2bson executable (neomantra)
|
299
|
-
* Fixed bson_ext compilation on Solaris (slyphon)
|
300
|
-
* System JS helpers (neovintage)
|
301
|
-
* Use one mutex per thread on pooled connections (cremes)
|
302
|
-
* Check for CursorNotFound response flag
|
303
|
-
* MapReduce can return raw command output using :raw
|
304
|
-
* BSON::OrderedHash equality with other Ruby hashes (Ryan Angilly)
|
305
|
-
* Fix for broken Socket.send with large payloads (Frédéric De Jaeger)
|
306
|
-
* Lots of minor improvements. See commmits.
|
307
|
-
|
308
|
-
### 1.0.3
|
309
|
-
2010-6-15
|
310
|
-
|
311
|
-
* Optimiztion for BSON::OrderedHash
|
312
|
-
* Some important fixes.
|
313
|
-
|
314
|
-
### 1.0.2
|
315
|
-
2010-6-5
|
316
|
-
|
317
|
-
This is a minor release for fixing an incompatibility with MongoDB v1.5.2
|
318
|
-
|
319
|
-
* Fix for boolean response on commands for core server v1.5.2
|
320
|
-
* BSON.read_bson_document and b2json executable (neomantra)
|
321
|
-
* BSON::ObjectID() shortcut for BSON::ObjectID.from_string (tmm1)
|
322
|
-
* Various bug fixes.
|
323
|
-
|
324
|
-
### 1.0.1
|
325
|
-
2010-5-7
|
326
|
-
|
327
|
-
* set Encoding.default_internal
|
328
|
-
* DEPRECATE JavaScript string on Collection#find. You now must specify $where explicitly.
|
329
|
-
* Added Grid#exist? and GridFileSystem#exist?
|
330
|
-
* Support for replication acknowledgment
|
331
|
-
* Support for $slice
|
332
|
-
* Namespaced OrderedHash under BSON (sleverbor)
|
333
|
-
|
334
|
-
## 1.0
|
335
|
-
2010-4-29
|
336
|
-
Note: if upgrading from versions prior to 0.20, be sure to upgrade
|
337
|
-
to 0.20 before upgrading to 1.0.
|
338
|
-
|
339
|
-
* Inspected ObjectID is represented in MongoDB extended json format.
|
340
|
-
* Support for tailable cursors.
|
341
|
-
* Configurable query response batch size (thx. to Aman Gupta)
|
342
|
-
|
343
|
-
* bson_ext installs on early release of Ruby 1.8.5 (dfitzgibbon)
|
344
|
-
* Deprecated DB#create_index. Use Collection#create_index index.
|
345
|
-
* Removed deprecated Grid#put syntax; no longer requires a filename.
|
346
|
-
|
347
|
-
### 0.20.1
|
348
|
-
2010-4-7
|
349
|
-
|
350
|
-
* Added bson gem dependency.
|
351
|
-
|
352
|
-
### 0.20
|
353
|
-
2010-4-7
|
354
|
-
|
355
|
-
If upgrading from a previous version of the Ruby driver, please read these notes carefully,
|
356
|
-
along with the 0.20_UPGRADE doc.
|
357
|
-
|
358
|
-
* Support for new commands:
|
359
|
-
* Collection#find_and_modify
|
360
|
-
* Collection#stats
|
361
|
-
* DB#stats
|
362
|
-
* Query :fields options allows for values of 0 to exclude fields (houdini, railsjedi).
|
363
|
-
* GridFS
|
364
|
-
* Option to delete old versions of GridFileSystem entries.
|
365
|
-
* Filename is now optional for Grid#put.
|
366
|
-
* Option to write arbitrary attributes to a file: @grid.put(@data, :favorite_phrase => "blimey!")
|
367
|
-
* Indexes created on the chunks collection are now unique. If you have an existing chunks collection,
|
368
|
-
you may want to remove
|
369
|
-
* Removed the following deprecated items:
|
370
|
-
* GridStore class
|
371
|
-
* RegexpOfHolding class
|
372
|
-
* Paired connections must now be initialized with Connection.paired
|
373
|
-
|
374
|
-
* BSON-related code extracted into two separate gems: bson and bson_ext (thx to Chuck Remes).
|
375
|
-
* mongo_ext no longer exists.
|
376
|
-
* BSON::Binary constructor can now take a string, which will be packed into an array.
|
377
|
-
* Exception class adjustments:
|
378
|
-
* Mongo::InvalidObjectID moved to BSON::InvalidObjectID
|
379
|
-
* Mongo::InvalidDocument moved to BSON::InvalidDocument
|
380
|
-
* Mongo::InvalidStringEncoding moved to BSON::InvalidStringEncoding
|
381
|
-
* Mongo::InvalidName replaced by Mongo::InvalidNSName and BSON::InvalidKeyName
|
382
|
-
* BSON types are now namespaced under the BSON module. These types include:
|
383
|
-
* Binary
|
384
|
-
* ObjectID
|
385
|
-
* Code
|
386
|
-
* DBRef
|
387
|
-
* MinKey and MaxKey
|
388
|
-
* Extensions compile on Rubinius (Chuck Remes).
|
389
|
-
|
390
|
-
## Prior to 0.20
|
391
|
-
|
392
|
-
See git revisions.
|