mongo 1.9.2 → 1.10.0.rc0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/LICENSE +1 -1
- data/README.md +94 -334
- data/Rakefile +6 -4
- data/VERSION +1 -1
- data/bin/mongo_console +13 -6
- data/lib/mongo.rb +22 -27
- data/lib/mongo/bulk_write_collection_view.rb +352 -0
- data/lib/mongo/collection.rb +128 -188
- data/lib/mongo/collection_writer.rb +348 -0
- data/lib/mongo/connection.rb +19 -0
- data/lib/mongo/{util → connection}/node.rb +15 -1
- data/lib/mongo/{util → connection}/pool.rb +34 -19
- data/lib/mongo/{util → connection}/pool_manager.rb +8 -2
- data/lib/mongo/{util → connection}/sharding_pool_manager.rb +1 -1
- data/lib/mongo/connection/socket.rb +18 -0
- data/lib/mongo/{util → connection/socket}/socket_util.rb +5 -2
- data/lib/mongo/{util → connection/socket}/ssl_socket.rb +3 -4
- data/lib/mongo/{util → connection/socket}/tcp_socket.rb +25 -15
- data/lib/mongo/{util → connection/socket}/unix_socket.rb +6 -4
- data/lib/mongo/cursor.rb +113 -47
- data/lib/mongo/db.rb +203 -131
- data/lib/mongo/{exceptions.rb → exception.rb} +7 -1
- data/lib/mongo/functional.rb +19 -0
- data/lib/mongo/functional/authentication.rb +303 -0
- data/lib/mongo/{util → functional}/logging.rb +1 -1
- data/lib/mongo/{util → functional}/read_preference.rb +49 -1
- data/lib/mongo/{util → functional}/uri_parser.rb +81 -69
- data/lib/mongo/{util → functional}/write_concern.rb +2 -1
- data/{test/unit/pool_test.rb → lib/mongo/gridfs.rb} +5 -10
- data/lib/mongo/gridfs/grid.rb +1 -3
- data/lib/mongo/gridfs/grid_ext.rb +1 -1
- data/lib/mongo/gridfs/grid_file_system.rb +1 -1
- data/lib/mongo/gridfs/grid_io.rb +1 -1
- data/lib/mongo/legacy.rb +63 -8
- data/lib/mongo/mongo_client.rb +128 -154
- data/lib/mongo/mongo_replica_set_client.rb +17 -11
- data/lib/mongo/mongo_sharded_client.rb +2 -1
- data/lib/mongo/networking.rb +19 -10
- data/lib/mongo/utils.rb +19 -0
- data/lib/mongo/{util → utils}/conversions.rb +1 -1
- data/lib/mongo/{util → utils}/core_ext.rb +1 -1
- data/lib/mongo/{util → utils}/server_version.rb +1 -1
- data/lib/mongo/{util → utils}/support.rb +10 -57
- data/lib/mongo/{util → utils}/thread_local_variable_manager.rb +1 -1
- data/test/functional/authentication_test.rb +8 -21
- data/test/functional/bulk_write_collection_view_test.rb +782 -0
- data/test/functional/{connection_test.rb → client_test.rb} +153 -78
- data/test/functional/collection_test.rb +343 -97
- data/test/functional/collection_writer_test.rb +83 -0
- data/test/functional/conversions_test.rb +1 -3
- data/test/functional/cursor_fail_test.rb +3 -3
- data/test/functional/cursor_message_test.rb +3 -3
- data/test/functional/cursor_test.rb +38 -3
- data/test/functional/db_api_test.rb +5 -5
- data/test/functional/db_connection_test.rb +2 -2
- data/test/functional/db_test.rb +35 -11
- data/test/functional/grid_file_system_test.rb +2 -2
- data/test/functional/grid_io_test.rb +2 -2
- data/test/functional/grid_test.rb +2 -2
- data/test/functional/pool_test.rb +2 -3
- data/test/functional/safe_test.rb +5 -5
- data/test/functional/ssl_test.rb +22 -102
- data/test/functional/support_test.rb +1 -1
- data/test/functional/timeout_test.rb +6 -22
- data/test/functional/uri_test.rb +113 -12
- data/test/functional/write_concern_test.rb +6 -6
- data/test/helpers/general.rb +50 -0
- data/test/helpers/test_unit.rb +309 -0
- data/test/replica_set/authentication_test.rb +8 -23
- data/test/replica_set/basic_test.rb +41 -14
- data/test/replica_set/client_test.rb +179 -117
- data/test/replica_set/complex_connect_test.rb +6 -7
- data/test/replica_set/connection_test.rb +46 -38
- data/test/replica_set/count_test.rb +2 -2
- data/test/replica_set/cursor_test.rb +8 -8
- data/test/replica_set/insert_test.rb +64 -2
- data/test/replica_set/max_values_test.rb +59 -10
- data/test/replica_set/pinning_test.rb +2 -2
- data/test/replica_set/query_test.rb +2 -2
- data/test/replica_set/read_preference_test.rb +6 -6
- data/test/replica_set/refresh_test.rb +7 -7
- data/test/replica_set/replication_ack_test.rb +5 -5
- data/test/replica_set/ssl_test.rb +24 -106
- data/test/sharded_cluster/basic_test.rb +43 -15
- data/test/shared/authentication/basic_auth_shared.rb +215 -0
- data/test/shared/authentication/sasl_plain_shared.rb +96 -0
- data/test/shared/ssl_shared.rb +173 -0
- data/test/test_helper.rb +31 -199
- data/test/threading/basic_test.rb +29 -3
- data/test/tools/mongo_config.rb +45 -20
- data/test/tools/mongo_config_test.rb +1 -1
- data/test/unit/client_test.rb +136 -57
- data/test/unit/collection_test.rb +31 -55
- data/test/unit/connection_test.rb +135 -72
- data/test/unit/cursor_test.rb +2 -2
- data/test/unit/db_test.rb +19 -15
- data/test/unit/grid_test.rb +2 -2
- data/test/unit/mongo_sharded_client_test.rb +17 -15
- data/test/unit/node_test.rb +2 -2
- data/test/unit/pool_manager_test.rb +7 -5
- data/test/unit/read_pref_test.rb +82 -2
- data/test/unit/read_test.rb +14 -14
- data/test/unit/safe_test.rb +9 -9
- data/test/unit/sharding_pool_manager_test.rb +11 -5
- data/test/unit/write_concern_test.rb +9 -9
- metadata +71 -56
- metadata.gz.sig +0 -0
- data/test/functional/threading_test.rb +0 -109
- data/test/shared/authentication.rb +0 -121
- data/test/unit/util_test.rb +0 -69
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cd7d73987a4420fcb416fb0cfa6c9f711b9dc00
|
4
|
+
data.tar.gz: ec9b4e834cfc4169a1035ad301c87ff2684639ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09f5296283a06b7d08619f347f8723e7423e0b126d29fbfbaf1c38594e0b5d3a65e0b71de1161882d61f98186bd544c80f5fe8dfc3ae3b09ad25acf98e9611cb
|
7
|
+
data.tar.gz: 4bde563936a1ff51ee037bb4289d8057316fed86e9b5e009612f85f7c41552e2746698a6c5114277783d179226703d7d1dfbcccfb12d8b315c7549f3dcd8db98
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/LICENSE
CHANGED
@@ -175,7 +175,7 @@
|
|
175
175
|
|
176
176
|
END OF TERMS AND CONDITIONS
|
177
177
|
|
178
|
-
Copyright (C) 2008-2013
|
178
|
+
Copyright (C) 2008-2013 MongoDB, Inc.
|
179
179
|
|
180
180
|
Licensed under the Apache License, Version 2.0 (the "License");
|
181
181
|
you may not use this file except in compliance with the License.
|
data/README.md
CHANGED
@@ -1,375 +1,126 @@
|
|
1
|
-
|
1
|
+
MongoDB Ruby Driver [![Build Status][travis-img]][travis-url] [![Code Climate][codeclimate-img]][codeclimate-url] [![Coverage Status][coveralls-img]][coveralls-url] [![Gem Version][rubygems-img]][rubygems-url]
|
2
|
+
-----
|
3
|
+
The officially supported Ruby driver for [MongoDB](http://www.mongodb.org).
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
-
[jenkins-img]: https://jenkins.10gen.com/job/mongo-ruby-driver-1.x-stable/badge/icon
|
6
|
-
[jenkins-url]: https://jenkins.10gen.com/job/mongo-ruby-driver-1.x-stable/
|
7
|
-
[api-url]: http://api.mongodb.org/ruby/current
|
8
|
-
- TravisCI [![Travis Status][travis-img]][travis-url]
|
9
|
-
- Jenkins [![Jenkins Status][jenkins-img]][jenkins-url]
|
5
|
+
Installation
|
6
|
+
-----
|
10
7
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
that matches the release of the Ruby driver that you are using. Note that the
|
16
|
-
[Ruby Language Center for MongoDB](http://www.mongodb.org/display/DOCS/Ruby+Language+Center)
|
17
|
-
has a link to API Documentation for the current release.
|
18
|
-
|
19
|
-
If you have the source, you can generate the matching documentation by typing
|
20
|
-
|
21
|
-
```sh
|
22
|
-
$ rake docs
|
23
|
-
```
|
24
|
-
|
25
|
-
Once generated, the API documentation can be found in the docs/ folder.
|
26
|
-
|
27
|
-
# Introduction
|
28
|
-
|
29
|
-
This is the 10gen-supported Ruby driver for [MongoDB](http://www.mongodb.org).
|
30
|
-
|
31
|
-
For the api reference please see the [API][api-url]
|
32
|
-
|
33
|
-
The [wiki](https://github.com/mongodb/mongo-ruby-driver/wiki) has other articles of interest, including:
|
34
|
-
|
35
|
-
1. [A tutorial](https://github.com/mongodb/mongo-ruby-driver/wiki/Tutorial).
|
36
|
-
2. [Replica Sets in Ruby](https://github.com/mongodb/mongo-ruby-driver/wiki/Replica-Sets).
|
37
|
-
3. [Write Concern in Ruby](https://github.com/mongodb/mongo-ruby-driver/wiki/Write-Concern).
|
38
|
-
4. [Tailable Cursors in Ruby](https://github.com/mongodb/mongo-ruby-driver/wiki/Tailable-Cursors).
|
39
|
-
5. [Read Preference in Ruby](https://github.com/mongodb/mongo-ruby-driver/wiki/Read-Preference).
|
40
|
-
6. [GridFS in Ruby](https://github.com/mongodb/mongo-ruby-driver/wiki/GridFS).
|
41
|
-
7. [Frequently Asked Questions](https://github.com/mongodb/mongo-ruby-driver/wiki/FAQ).
|
42
|
-
8. [History](https://github.com/mongodb/mongo-ruby-driver/wiki/History).
|
43
|
-
9. [Release plan](https://github.com/mongodb/mongo-ruby-driver/wiki/Releases).
|
44
|
-
10. [Credits](https://github.com/mongodb/mongo-ruby-driver/wiki/Credits).
|
45
|
-
|
46
|
-
Here's a quick code sample. Again, see the [MongoDB Ruby Tutorial](https://github.com/mongodb/mongo-ruby-driver/wiki/Tutorial) for much more:
|
47
|
-
|
48
|
-
```ruby
|
49
|
-
require 'rubygems'
|
50
|
-
require 'mongo'
|
51
|
-
|
52
|
-
include Mongo
|
53
|
-
|
54
|
-
@client = MongoClient.new('localhost', 27017)
|
55
|
-
@db = @client['sample-db']
|
56
|
-
@coll = @db['test']
|
57
|
-
|
58
|
-
@coll.remove
|
59
|
-
|
60
|
-
3.times do |i|
|
61
|
-
@coll.insert({'a' => i+1})
|
62
|
-
end
|
63
|
-
|
64
|
-
puts "There are #{@coll.count} records. Here they are:"
|
65
|
-
@coll.find.each { |doc| puts doc.inspect }
|
8
|
+
**Gem Installation**<br>
|
9
|
+
The Ruby driver is released and distributed through RubyGems and it can be installed with the following command:
|
10
|
+
```bash
|
11
|
+
gem install mongo
|
66
12
|
```
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
### Ruby Versions
|
71
|
-
|
72
|
-
The driver works and is consistently tested on Ruby 1.8.7 and 1.9.3 as well as JRuby 1.6.x and 1.7.x.
|
73
|
-
|
74
|
-
Note that if you're on 1.8.7, be sure that you're using a patchlevel >= 249. There are some IO bugs in earlier versions.
|
75
|
-
|
76
|
-
### Gems
|
77
|
-
|
78
|
-
```sh
|
79
|
-
$ gem update --system
|
80
|
-
$ gem install mongo
|
13
|
+
For a significant performance boost, you'll want to install the C-extension:
|
14
|
+
```bash
|
15
|
+
gem install bson_ext
|
81
16
|
```
|
17
|
+
**Github Installation**<br>
|
18
|
+
For development and test environments (not recommended for production) you can also install the Ruby driver directly from source:
|
82
19
|
|
83
|
-
|
20
|
+
```bash
|
21
|
+
# clone the repository
|
22
|
+
git clone https://github.com/mongodb/mongo-ruby-driver.git
|
23
|
+
cd mongo-ruby-driver
|
84
24
|
|
85
|
-
|
86
|
-
|
87
|
-
```
|
25
|
+
# checkout a specific version by tag (optional)
|
26
|
+
git checkout 1.x.x
|
88
27
|
|
89
|
-
|
28
|
+
# install all development dependencies
|
29
|
+
gem install bundler
|
30
|
+
bundle install
|
90
31
|
|
91
|
-
|
92
|
-
|
32
|
+
# install the ruby driver
|
33
|
+
rake install
|
93
34
|
```
|
94
35
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
You can either clone the git repository or download a tarball or zip file.
|
99
|
-
Once you have the source, you can use it from wherever you downloaded it or
|
100
|
-
you can install it as a gem from the source by typing:
|
101
|
-
|
102
|
-
```sh
|
103
|
-
$ rake install
|
104
|
-
```
|
105
|
-
|
106
|
-
# Examples
|
107
|
-
|
108
|
-
For extensive examples, see the [MongoDB Ruby Tutorial](https://github.com/mongodb/mongo-ruby-driver/wiki/Tutorial).
|
109
|
-
|
110
|
-
# GridFS
|
111
|
-
|
112
|
-
The Ruby driver include two abstractions for storing large files: Grid and GridFileSystem.
|
113
|
-
|
114
|
-
The Grid class is a Ruby implementation of MongoDB's GridFS file storage
|
115
|
-
specification. GridFileSystem is essentially the same, but provides a more filesystem-like API and assumes that filenames are unique.
|
116
|
-
|
117
|
-
An instance of both classes represents an individual file store. See the API reference for details.
|
118
|
-
|
119
|
-
Examples:
|
120
|
-
|
121
|
-
```ruby
|
122
|
-
# Write a file on disk to the Grid
|
123
|
-
file = File.open('image.jpg')
|
124
|
-
grid = Mongo::Grid.new(db)
|
125
|
-
id = grid.put(file)
|
126
|
-
|
127
|
-
# Retrieve the file
|
128
|
-
file = grid.get(id)
|
129
|
-
file.read
|
130
|
-
|
131
|
-
# Get all the file's metata
|
132
|
-
file.filename
|
133
|
-
file.content_type
|
134
|
-
file.metadata
|
135
|
-
```
|
136
|
-
|
137
|
-
# Notes
|
138
|
-
|
139
|
-
## Thread Safety
|
140
|
-
|
141
|
-
The driver is thread-safe.
|
142
|
-
|
143
|
-
## Connection Pooling
|
144
|
-
|
145
|
-
The driver implements connection pooling. By default, only one
|
146
|
-
socket connection will be opened to MongoDB. However, if you're running a
|
147
|
-
multi-threaded application, you can specify a maximum pool size and a maximum
|
148
|
-
timeout for waiting for old connections to be released to the pool.
|
149
|
-
|
150
|
-
To set up a pooled connection to a single MongoDB instance:
|
151
|
-
|
152
|
-
```ruby
|
153
|
-
@client = MongoClient.new("localhost", 27017, :pool_size => 5, :pool_timeout => 5)
|
154
|
-
```
|
155
|
-
|
156
|
-
Though the pooling architecture will undoubtedly evolve, it currently owes much credit
|
157
|
-
to the connection pooling implementations in ActiveRecord and PyMongo.
|
158
|
-
|
159
|
-
## Forking
|
160
|
-
|
161
|
-
Certain Ruby application servers work by forking, and it has long been necessary to
|
162
|
-
re-establish the child process's connection to the database after fork. But with the release
|
163
|
-
of v1.3.0, the Ruby driver detects forking and reconnects automatically.
|
164
|
-
|
165
|
-
## Environment variable `MONGODB_URI`
|
166
|
-
|
167
|
-
`Mongo::MongoClient.from_uri`, `Mongo::MongoClient.new` and `Mongo::MongoReplicaSetClient.new` will use <code>ENV["MONGODB_URI"]</code> if no other args are provided.
|
168
|
-
|
169
|
-
The URI must fit this specification:
|
170
|
-
|
171
|
-
mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]
|
172
|
-
|
173
|
-
If the type of connection (direct or replica set) should be determined entirely from <code>ENV["MONGODB_URI"]</code>, you may want to use `Mongo::MongoClient.from_uri` because it will return either `Mongo::MongoClient` or a `Mongo::MongoReplicaSetClient` depending on how many hosts are specified. Trying to use `Mongo::MongoClient.new` with multiple hosts in <code>ENV["MONGODB_URI"]</code> will raise an exception.
|
174
|
-
|
175
|
-
## String Encoding
|
176
|
-
|
177
|
-
The BSON ("Binary JSON") format used to communicate with Mongo requires that
|
178
|
-
strings be UTF-8 (http://en.wikipedia.org/wiki/UTF-8).
|
179
|
-
|
180
|
-
Ruby 1.9 has built-in character encoding support. All strings sent to Mongo
|
181
|
-
and received from Mongo are converted to UTF-8 when necessary, and strings
|
182
|
-
read from Mongo will have their character encodings set to UTF-8.
|
183
|
-
|
184
|
-
When used with Ruby 1.8, the bytes in each string are written to and read from
|
185
|
-
Mongo as is. If the string is ASCII, all is well, because ASCII is a subset of
|
186
|
-
UTF-8. If the string is not ASCII, it may not be a well-formed UTF-8
|
187
|
-
string.
|
188
|
-
|
189
|
-
## Primary Keys
|
190
|
-
|
191
|
-
The `_id` field is a primary key. It is treated specially by the database, and
|
192
|
-
its use makes many operations more efficient. The value of an _id may be of
|
193
|
-
any type. The database itself inserts an _id value if none is specified when
|
194
|
-
a record is inserted.
|
195
|
-
|
196
|
-
### Primary Key Factories
|
197
|
-
|
198
|
-
A primary key factory is a class you supply to a DB object that knows how to
|
199
|
-
generate _id values. If you want to control _id values or even their types,
|
200
|
-
using a PK factory lets you do so.
|
201
|
-
|
202
|
-
You can tell the Ruby Mongo driver how to create primary keys by passing in
|
203
|
-
the :pk option to the MongoClient#db method.
|
204
|
-
|
36
|
+
Usage
|
37
|
+
-----
|
38
|
+
Here is a quick example of basic usage for the Ruby driver:
|
205
39
|
```ruby
|
40
|
+
require 'mongo'
|
206
41
|
include Mongo
|
207
|
-
db = MongoClient.new('localhost', 27017).db('dbname', :pk => MyPKFactory.new)
|
208
|
-
```
|
209
42
|
|
210
|
-
|
211
|
-
|
212
|
-
|
43
|
+
# connecting to the database
|
44
|
+
client = MongoClient.new # defaults to localhost:27017
|
45
|
+
db = client['example-db']
|
46
|
+
coll = db['example-collection']
|
213
47
|
|
214
|
-
|
215
|
-
|
216
|
-
database. The idea here is that whenever a record is inserted, the
|
217
|
-
:pk object's +create_pk+ method will be called and the new hash
|
218
|
-
returned will be inserted.
|
48
|
+
# inserting documents
|
49
|
+
10.times { |i| coll.insert({ :count => i+1 }) }
|
219
50
|
|
220
|
-
|
51
|
+
# finding documents
|
52
|
+
puts "There are #{coll.count} total documents. Here they are:"
|
53
|
+
coll.find.each { |doc| puts doc.inspect }
|
221
54
|
|
222
|
-
|
223
|
-
|
224
|
-
def create_pk(doc)
|
225
|
-
doc['_id'] ||= BSON::ObjectId.new
|
226
|
-
doc
|
227
|
-
end
|
228
|
-
end
|
229
|
-
```
|
55
|
+
# updating documents
|
56
|
+
coll.update({ :count => 5 }, { :count => 'foobar' })
|
230
57
|
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
(for Rails):
|
235
|
-
|
236
|
-
```ruby
|
237
|
-
class PKFactory
|
238
|
-
def create_pk(doc)
|
239
|
-
return doc if doc[:_id]
|
240
|
-
doc.delete(:_id) # in case it exists but the value is nil
|
241
|
-
doc['_id'] ||= BSON::ObjectId.new
|
242
|
-
doc
|
243
|
-
end
|
244
|
-
end
|
58
|
+
# removing documents
|
59
|
+
coll.remove({ :count => 8 })
|
60
|
+
coll.remove
|
245
61
|
```
|
246
62
|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
driver can set the PK factory after obtaining the database but before using it
|
251
|
-
for the first time.
|
252
|
-
|
253
|
-
## The DB Class
|
254
|
-
|
255
|
-
### Strict mode
|
256
|
-
|
257
|
-
_**NOTE:** Support for strict mode has been deprecated and will be removed in version 2.0 of the driver._
|
63
|
+
Wiki - Tutorials & Examples
|
64
|
+
-----
|
65
|
+
For many more usage examples and a full tutorial, please visit our [wiki](https://github.com/mongodb/mongo-ruby-driver/wiki).<br>
|
258
66
|
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
completely harmless; strict mode is a programmer convenience only.
|
67
|
+
API Reference Documentation
|
68
|
+
-----
|
69
|
+
For API reference documentation, please visit [here](http://api.mongodb.org/ruby).
|
263
70
|
|
264
|
-
|
265
|
-
|
71
|
+
Compatibility
|
72
|
+
-----
|
73
|
+
The MongoDB Ruby driver requires Ruby 1.8.7 or greater and is regularly tested against the platforms and environments listed below.
|
266
74
|
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
db.strict = false
|
271
|
-
# No, I'm not!
|
272
|
-
db.strict = true
|
273
|
-
```
|
75
|
+
Ruby Platforms | Operating Systems | Architectures
|
76
|
+
-------------- | ----------------- | -------------
|
77
|
+
MRI 1.8.7, 1.9.3, 2.0.0<br>JRuby 1.7.x | Windows<br>Linux<br>OS X | x86<br>x64<br>ARM
|
274
78
|
|
275
|
-
|
79
|
+
Support & Feedback
|
80
|
+
-----
|
276
81
|
|
277
|
-
|
82
|
+
For issues, questions or feedback related to the Ruby driver, please look into
|
83
|
+
our [support channels](http://www.mongodb.org/about/support). Please
|
84
|
+
do not email any of the Ruby developers directly with issues or
|
85
|
+
questions - you're more likely to get an answer quickly on the [mongodb-user list](http://groups.google.com/group/mongodb-user) on Google Groups.
|
278
86
|
|
279
|
-
|
87
|
+
Bugs & Feature Requests
|
88
|
+
-----
|
280
89
|
|
281
|
-
|
90
|
+
Do you have a bug to report or a feature request to make?
|
282
91
|
|
283
|
-
|
284
|
-
|
92
|
+
1. Visit [our issue tracker](https://jira.mongodb.org) and login (or create an account if necessary).
|
93
|
+
2. Navigate to the [RUBY](https://jira.mongodb.org/browse/RUBY) project.
|
94
|
+
3. Click 'Create Issue' and fill out all the applicable form fields.
|
285
95
|
|
286
|
-
|
287
|
-
open for more than 10 minutes, specify `:timeout => false` when you create the cursor.
|
96
|
+
When reporting an issue, please keep in mind that all information in JIRA for all driver projects (ex. RUBY, CSHARP, JAVA) and the Core Server (ex. SERVER) project is **PUBLICLY** visible.
|
288
97
|
|
289
|
-
|
98
|
+
**PLEASE DO**
|
290
99
|
|
291
|
-
|
292
|
-
|
100
|
+
* Provide as much information as possible about the issue.
|
101
|
+
* Provide detailed steps for reproducing the issue.
|
102
|
+
* Provide any applicable code snippets, stack traces and log data.
|
103
|
+
* Specify version information for the driver and MongoDB.
|
293
104
|
|
294
|
-
|
295
|
-
to call `Mongo::MongoClient#close` to prevent the subsequent operation from receiving the previous
|
296
|
-
request.
|
105
|
+
**PLEASE DO NOT**
|
297
106
|
|
298
|
-
|
107
|
+
* Provide any sensitive data or server logs.
|
108
|
+
* Report potential security issues publicly (see 'Security Issues').
|
299
109
|
|
300
|
-
|
110
|
+
Security Issues
|
111
|
+
-----
|
301
112
|
|
302
|
-
|
303
|
-
$ gem install bundler; bundle install
|
304
|
-
```
|
113
|
+
If you’ve identified a potential security related issue in a driver or any other MongoDB project, please report it by following the [instructions here](http://docs.mongodb.org/manual/tutorial/create-a-vulnerability-report).
|
305
114
|
|
306
|
-
|
115
|
+
Release History
|
116
|
+
-----
|
307
117
|
|
308
|
-
|
309
|
-
$ rake test
|
310
|
-
```
|
118
|
+
Full release notes and release history are available [here](https://github.com/mongodb/mongo-ruby-driver/releases).
|
311
119
|
|
312
|
-
|
120
|
+
License
|
121
|
+
-----
|
313
122
|
|
314
|
-
|
315
|
-
$ rake test:ext
|
316
|
-
```
|
317
|
-
|
318
|
-
These will run both unit and functional tests. To run these tests alone:
|
319
|
-
|
320
|
-
```sh
|
321
|
-
$ rake test:unit
|
322
|
-
$ rake test:functional
|
323
|
-
```
|
324
|
-
|
325
|
-
To run any individual rake tasks with the BSON extension disabled, just pass BSON_EXT_DISABLED=true to the task:
|
326
|
-
|
327
|
-
```sh
|
328
|
-
$ rake test:unit BSON_EXT_DISABLED=true
|
329
|
-
```
|
330
|
-
|
331
|
-
If you want to test replica set, you can run the following task:
|
332
|
-
|
333
|
-
```sh
|
334
|
-
$ rake test:replica_set
|
335
|
-
```
|
336
|
-
|
337
|
-
To run a single test at the top level, add -Itest since we no longer modify LOAD_PATH:
|
338
|
-
|
339
|
-
```sh
|
340
|
-
$ ruby -Itest -Ilib test/bson/bson_test.rb
|
341
|
-
```
|
342
|
-
|
343
|
-
To run a single test from the test directory, add -I. since we no longer modify LOAD_PATH:
|
344
|
-
|
345
|
-
```sh
|
346
|
-
$ ruby -I. -I../lib bson/bson_test.rb
|
347
|
-
```
|
348
|
-
|
349
|
-
To run a single test from its subdirectory, add -I.. since we no longer modify LOAD_PATH:
|
350
|
-
|
351
|
-
```sh
|
352
|
-
$ ruby -I.. -I../../lib bson_test.rb
|
353
|
-
```
|
354
|
-
|
355
|
-
To fix the following error on Mac OS X - "/.../lib/bson_ext/cbson.bundle: [BUG] Segmentation fault":
|
356
|
-
|
357
|
-
```sh
|
358
|
-
$ rake compile
|
359
|
-
```
|
360
|
-
|
361
|
-
# Release Notes
|
362
|
-
|
363
|
-
See [history](https://github.com/mongodb/mongo-ruby-driver/wiki/History).
|
364
|
-
|
365
|
-
|
366
|
-
# Credits
|
367
|
-
|
368
|
-
See [credits](https://github.com/mongodb/mongo-ruby-driver/wiki/Credits).
|
369
|
-
|
370
|
-
# License
|
371
|
-
|
372
|
-
Copyright (C) 2008-2013 10gen Inc.
|
123
|
+
Copyright (C) 2009-2013 MongoDB, Inc.
|
373
124
|
|
374
125
|
Licensed under the Apache License, Version 2.0 (the "License");
|
375
126
|
you may not use this file except in compliance with the License.
|
@@ -382,3 +133,12 @@ See [credits](https://github.com/mongodb/mongo-ruby-driver/wiki/Credits).
|
|
382
133
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
383
134
|
See the License for the specific language governing permissions and
|
384
135
|
limitations under the License.
|
136
|
+
|
137
|
+
[rubygems-img]: https://badge.fury.io/rb/mongo.png
|
138
|
+
[rubygems-url]: http://badge.fury.io/rb/mongo
|
139
|
+
[travis-img]: https://secure.travis-ci.org/mongodb/mongo-ruby-driver.png?branch=1.x-stable
|
140
|
+
[travis-url]: http://travis-ci.org/mongodb/mongo-ruby-driver?branch=1.x-stable
|
141
|
+
[codeclimate-img]: https://codeclimate.com/github/mongodb/mongo-ruby-driver.png?branch=1.x-stable
|
142
|
+
[codeclimate-url]: https://codeclimate.com/github/mongodb/mongo-ruby-driver?branch=1.x-stable
|
143
|
+
[coveralls-img]: https://coveralls.io/repos/mongodb/mongo-ruby-driver/badge.png?branch=1.x-stable
|
144
|
+
[coveralls-url]: https://coveralls.io/r/mongodb/mongo-ruby-driver?branch=1.x-stable
|