Skip to content

Commit 1ef890e

Browse files
p-mongop
andauthored
MONGOID-5163 Drop support for MongoDB < 3.6 (#5186)
Co-authored-by: Oleg Pudeyev <[email protected]>
1 parent 07e3a87 commit 1ef890e

File tree

7 files changed

+55
-160
lines changed

7 files changed

+55
-160
lines changed

.evergreen/config.yml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -347,22 +347,6 @@ axes:
347347
display_name: "MongoDB 3.6"
348348
variables:
349349
VERSION: "3.6"
350-
- id: "3.4"
351-
display_name: "MongoDB 3.4"
352-
variables:
353-
VERSION: "3.4"
354-
- id: "3.2"
355-
display_name: "MongoDB 3.2"
356-
variables:
357-
VERSION: "3.2"
358-
- id: "3.0"
359-
display_name: "MongoDB 3.0"
360-
variables:
361-
VERSION: "3.0"
362-
- id: "2.6"
363-
display_name: "MongoDB 2.6"
364-
variables:
365-
VERSION: "2.6"
366350
- id: "topology"
367351
display_name: Topology
368352
values:

docs/reference/compatibility.txt

Lines changed: 29 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ is deprecated.
8585
- Ruby 2.2
8686
- JRuby 9.2
8787

88+
* - 8.0
89+
- |checkmark|
90+
- |checkmark|
91+
- |checkmark|
92+
- |checkmark|
93+
- |checkmark|
94+
-
95+
-
96+
-
97+
- |checkmark|
98+
8899
* - 7.4
89100
- |checkmark|
90101
- |checkmark|
@@ -193,6 +204,17 @@ and will be removed in a next version.
193204
- MongoDB 3.0
194205
- MongoDB 2.6
195206

207+
* - 8.0
208+
- |checkmark|
209+
- |checkmark|
210+
- |checkmark|
211+
- |checkmark|
212+
- |checkmark|
213+
-
214+
-
215+
-
216+
-
217+
196218
* - 7.4
197219
- |checkmark|
198220
- |checkmark|
@@ -279,116 +301,55 @@ are supported by Mongoid.
279301
- Rails 6.0
280302
- Rails 5.2
281303
- Rails 5.1
282-
- Rails 5.0
283-
- Rails 4.2
304+
305+
* - 8.0
306+
- |checkmark|
307+
- |checkmark|
308+
- |checkmark|
309+
- |checkmark| [#rails-5-ruby-3.0]_
310+
- |checkmark| [#rails-5-ruby-3.0]_
284311

285312
* - 7.4
286313
- |checkmark|
287314
- |checkmark|
288315
- |checkmark|
289316
- |checkmark| [#rails-5-ruby-3.0]_
290317
- |checkmark| [#rails-5-ruby-3.0]_
291-
-
292-
-
293318

294319
* - 7.3
295320
- |checkmark| [#rails-7-Mongoid-7.3]_
296321
- |checkmark|
297322
- |checkmark|
298323
- |checkmark| [#rails-5-ruby-3.0]_
299324
- |checkmark| [#rails-5-ruby-3.0]_
300-
-
301-
-
302325

303326
* - 7.2
304327
-
305328
- |checkmark| [#rails-6.1]_
306329
- |checkmark|
307330
- |checkmark| [#rails-5-ruby-3.0]_
308331
- |checkmark| [#rails-5-ruby-3.0]_
309-
-
310-
-
311332

312333
* - 7.1
313334
-
314335
- |checkmark| [#rails-6.1]_
315336
- |checkmark|
316337
- |checkmark|
317338
- |checkmark|
318-
-
319-
-
320339

321340
* - 7.0
322341
-
323342
- |checkmark| [#rails-6.1]_
324343
- |checkmark| [#rails-6]_
325344
- |checkmark|
326345
- |checkmark|
327-
-
328-
-
329346

330347
* - 6.4
331348
-
332349
-
333350
-
334351
- |checkmark|
335352
- |checkmark|
336-
-
337-
-
338-
339-
* - 6.3
340-
-
341-
-
342-
-
343-
- |checkmark|
344-
- |checkmark|
345-
-
346-
-
347-
348-
* - 6.2
349-
-
350-
-
351-
-
352-
- |checkmark|
353-
- |checkmark|
354-
-
355-
-
356-
357-
* - 6.1
358-
-
359-
-
360-
-
361-
-
362-
-
363-
- |checkmark|
364-
-
365-
366-
* - 6.0
367-
-
368-
-
369-
-
370-
-
371-
-
372-
- |checkmark|
373-
-
374-
375-
* - 5.4
376-
-
377-
-
378-
-
379-
-
380-
-
381-
-
382-
- |checkmark|
383-
384-
* - 5.2
385-
-
386-
-
387-
-
388-
-
389-
-
390-
-
391-
- |checkmark|
392353

393354
.. [#rails-5-ruby-3.0] Using Rails 5.x with Ruby 3 is not supported.
394355

docs/release-notes/mongoid-7.4.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ As of version 7.4, Mongoid supports Ruby 2.5+.
2929
Support for Ruby 2.4 and earlier has been dropped.
3030

3131

32+
Support for MongoDB 3.4 and Earlier Servers Deprecated
33+
------------------------------------------------------
34+
35+
Mongoid 7.4 deprecates support for MongoDB 3.4 and earlier.
36+
Mongoid 8 will require MongoDB 3.6 or newer.
37+
38+
3239
Change ``===`` Operator To Match Ruby Semantics
3340
-----------------------------------------------
3441

docs/release-notes/mongoid-8.0.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ please consult GitHub releases for detailed release notes and JIRA for
1818
the complete list of issues fixed in each release, including bug fixes.
1919

2020

21+
Support for MongoDB 3.4 and Earlier Servers Dropped
22+
---------------------------------------------------
23+
24+
Mongoid 8 requires MongoDB 3.6 or newer. Earlier server versions are not
25+
supported.
26+
27+
2128
Default Option Values Changed
2229
-----------------------------
2330

spec/mongoid/clients/sessions_spec.rb

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -166,25 +166,6 @@
166166
end
167167
end
168168
end
169-
170-
context 'when sessions are not supported' do
171-
max_server_version '3.4'
172-
173-
let!(:error) do
174-
e = nil
175-
begin
176-
Person.with_session {}
177-
rescue => ex
178-
e = ex
179-
end
180-
e
181-
end
182-
183-
it 'raises a sessions not supported error' do
184-
expect(error).to be_a(Mongoid::Errors::InvalidSessionUse)
185-
expect(error.message).to include('not supported')
186-
end
187-
end
188169
end
189170

190171
context 'when a session is used on a model instance' do
@@ -312,24 +293,5 @@
312293
end
313294
end
314295
end
315-
316-
context 'when sessions are not supported' do
317-
max_server_version '3.4'
318-
319-
let!(:error) do
320-
e = nil
321-
begin
322-
person.with_session {}
323-
rescue => ex
324-
e = ex
325-
end
326-
e
327-
end
328-
329-
it 'raises a sessions not supported error' do
330-
expect(error).to be_a(Mongoid::Errors::InvalidSessionUse)
331-
expect(error.message).to include('not supported')
332-
end
333-
end
334296
end
335297
end

spec/mongoid/contextual/map_reduce_spec.rb

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -194,22 +194,8 @@
194194
Band.where(name: 'DEPECHE MODE').collation(locale: 'en_US', strength: 2)
195195
end
196196

197-
context 'when the server supports collations' do
198-
min_server_version '3.4'
199-
200-
it 'applies the collation' do
201-
expect(map_reduce.out(inline: 1).count).to eq(1)
202-
end
203-
end
204-
205-
context 'when the server does not support collations' do
206-
max_server_version '3.2'
207-
208-
it 'raises an exception' do
209-
expect {
210-
map_reduce.out(inline: 1).to_a
211-
}.to raise_exception(Mongo::Error::UnsupportedCollation)
212-
end
197+
it 'applies the collation' do
198+
expect(map_reduce.out(inline: 1).count).to eq(1)
213199
end
214200
end
215201
end

spec/mongoid/document_fields_spec.rb

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,16 @@
8686
end
8787

8888
context 'Regexp field' do
89-
shared_examples "persists strings as regexp" do |type|
90-
it 'persists strings as regexp' do
91-
mop = Mop.create!(regexp_field: 'foo')
92-
expect(mop.regexp_field).to be_a Regexp
93-
expect(Mop.find(mop.id).regexp_field).to be_a BSON::Regexp::Raw
94-
expect(
95-
Mop.collection.find(
96-
"_id" => mop.id,
97-
"regexp_field" => { "$type" => type }
98-
).count
99-
).to be == 1
100-
end
101-
end
102-
103-
context "< 3.2" do
104-
max_server_version("3.1")
105-
include_examples "persists strings as regexp", 11
106-
end
107-
108-
context ">= 3.2" do
109-
min_server_version("3.2")
110-
it_behaves_like "persists strings as regexp", "regex"
89+
it 'persists strings as regexp' do
90+
mop = Mop.create!(regexp_field: 'foo')
91+
expect(mop.regexp_field).to be_a Regexp
92+
expect(Mop.find(mop.id).regexp_field).to be_a BSON::Regexp::Raw
93+
expect(
94+
Mop.collection.find(
95+
"_id" => mop.id,
96+
"regexp_field" => { "$type" => 'regex' }
97+
).count
98+
).to be == 1
11199
end
112100
end
113101
end

0 commit comments

Comments
 (0)