Skip to content

Commit

Permalink
Drop support for mongoid 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
dblock committed Sep 7, 2024
1 parent 5f41285 commit 16a4f60
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 335 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ jobs:
strategy:
matrix:
entry:
- { ruby: '2.6', mongodb: '4.4', mongoid: '5' }
- { ruby: '3.2', mongodb: '6.0', mongoid: '5' }
- { ruby: '2.7', mongodb: '4.4', mongoid: '6' }
- { ruby: '2.7', mongodb: '4.4', mongoid: '7' }
- { ruby: '3.0', mongodb: '4.4', mongoid: '6' }
Expand Down
3 changes: 1 addition & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ Style/Documentation:
Exclude:
- 'spec/**/*'
- 'test/**/*'
- 'examples/mongoid_scroll_feed.rb'
- 'lib/mongo/scrollable.rb'
- 'examples/feed.rb'
- 'lib/mongoid/criteria/scrollable.rb'
- 'lib/mongoid/scroll/base_cursor.rb'
- 'lib/mongoid/scroll/cursor.rb'
Expand Down
11 changes: 6 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* [#38](https://github.com/mongoid/mongoid-scroll/pull/38): Add `previous_cursor` - [@GCorbel](https://github.com/GCorbel).
* [#42](https://github.com/mongoid/mongoid-scroll/pull/42): Add `first_cursor` - [@GCorbel](https://github.com/GCorbel).
* [#43](https://github.com/mongoid/mongoid-scroll/pull/43): Add `current_cursor` - [@GCorbel](https://github.com/GCorbel).
* [#44](https://github.com/mongoid/mongoid-scroll/pull/44): Drop support for Mogoid 5 and Mongo Ruby Driver - [@dblock](https://github.com/dblock).
* Your contribution here.

### 1.0.1 (2023/03/15)
Expand All @@ -16,8 +17,8 @@
* [#29](https://github.com/mongoid/mongoid-scroll/pull/29): Add ability to include the current record to the cursor - [@FabienChaynes](https://github.com/FabienChaynes).
* [#30](https://github.com/mongoid/mongoid-scroll/pull/30): Prevent discrepancy between the original sort and the cursor sort - [@FabienChaynes](https://github.com/FabienChaynes).
* [#32](https://github.com/mongoid/mongoid-scroll/pull/32): Add Base64 serialization for cursors - [@FabienChaynes](https://github.com/FabienChaynes).
* [#33](https://github.com/mongoid/mongoid-scroll/pull/33): Removed support for Mongoid 3, 4 and Moped - [@dblock](https://github.com/dblock).
* [#34](https://github.com/mongoid/mongoid-scroll/pull/34): Added support for Mongoid 8 - [@dblock](https://github.com/dblock).
* [#33](https://github.com/mongoid/mongoid-scroll/pull/33): Remove support for Mongoid 3, 4 and Moped - [@dblock](https://github.com/dblock).
* [#34](https://github.com/mongoid/mongoid-scroll/pull/34): Add support for Mongoid 8 - [@dblock](https://github.com/dblock).

### 0.3.7 (2021/06/01)

Expand All @@ -32,7 +33,7 @@
### 0.3.5 (2016/09/27)

* [#11](https://github.com/mongoid/mongoid-scroll/pull/11): Compatibility with Mongoid 6 - [@dblock](https://github.com/dblock).
* [#12](https://github.com/mongoid/mongoid-scroll/pull/12): Added Danger, PR linter - [@dblock](https://github.com/dblock).
* [#12](https://github.com/mongoid/mongoid-scroll/pull/12): Add Danger, PR linter - [@dblock](https://github.com/dblock).

### 0.3.4 (2015/10/22)

Expand All @@ -55,15 +56,15 @@
### 0.3.0 (2014/1/7)

* Compatibility with Mongoid 4.x - [@dblock](https://github.com/dblock).
* Implemeneted Rubocop, Ruby linter - [@dblock](https://github.com/dblock).
* Implemenet Rubocop, Ruby linter - [@dblock](https://github.com/dblock).

### 0.2.1 (2013/3/21)

* Fix: scroll over a collection that has duplicate values while data is being modified in a way that causes a change in the natural sort order - [@dblock](https://github.com/dblock).

### 0.2.0 (2013/3/14)

* Extended `Moped::Query` with `scroll` - [@dblock](https://github.com/dblock).
* Extend `Moped::Query` with `scroll` - [@dblock](https://github.com/dblock).
* `Mongoid::Scroll::Cursor.from_record` can now be called with either a Mongoid field or `field_type` and `field_name` in the `options` hash - [@dblock](https://github.com/dblock).

### 0.1.0 (2013/2/14)
Expand Down
3 changes: 0 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ when 'HEAD' then gem 'mongoid', github: 'mongodb/mongoid'
when /8/ then gem 'mongoid', '~> 8.0'
when /7/ then gem 'mongoid', '~> 7.0'
when /6/ then gem 'mongoid', '~> 6.0'
when /5/ then
gem 'bigdecimal', '1.3.5'
gem 'mongoid', '~> 5.0'
else gem 'mongoid', version
end

Expand Down
31 changes: 3 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
- [The Problem](#the-problem)
- [Installation](#installation)
- [Usage](#usage)
- [Mongoid](#mongoid)
- [Mongo-Ruby-Driver (Mongoid 5)](#mongo-ruby-driver-mongoid-5)
- [Indexes and Performance](#indexes-and-performance)
- [Cursors](#cursors)
- [Standard Cursor](#standard-cursor)
Expand All @@ -24,13 +22,13 @@ Mongoid extension that enables infinite scrolling for `Mongoid::Criteria` and `M

## Compatibility

This gem supports Mongoid 5, 6, 7 and 8.
This gem supports Mongoid 6, 7 and 8.

## Demo

Check out [shows on artsy.net](http://artsy.net/shows). Keep scrolling down.

There're also two code samples for Mongoid in [examples](examples). Run `bundle exec ruby examples/mongoid_scroll_feed.rb`.
There're also two code samples for Mongoid in [examples](examples). Run `bundle exec ruby examples/feed.rb`.

## The Problem

Expand All @@ -51,8 +49,6 @@ gem 'mongoid-scroll'

## Usage

### Mongoid

A sample model.

```ruby
Expand Down Expand Up @@ -106,27 +102,6 @@ Feed::Item.desc(:position).limit(5).scroll(saved_iterator.next_cursor) do |recor
end
```

### Mongo-Ruby-Driver (Mongoid 5)

Scroll a `Mongo::Collection::View` and save a cursor to the last item. You must also supply a `field_type` of the sort criteria.

```ruby
saved_iterator = nil
client[:feed_items].find.sort(position: -1).limit(5).scroll(nil, { field_type: DateTime }) do |record, iterator|
# each record, one-by-one
saved_iterator = iterator
end
```

Resume iterating using the previously saved cursor.

```ruby
session[:feed_items].find.sort(position: -1).limit(5).scroll(saved_iterator.next_cursor, { field_type: DateTime }) do |record, iterator|
# each record, one-by-one
saved_iterator = iterator
end
```

## Indexes and Performance

A query without a cursor is identical to a query without a scroll.
Expand Down Expand Up @@ -212,4 +187,4 @@ Fork the project. Make your feature addition or bug fix with tests. Send a pull

MIT License, see [LICENSE](http://github.com/mongoid/mongoid-scroll/raw/master/LICENSE.md) for details.

(c) 2013-2023 [Daniel Doubrovkine](http://github.com/dblock), based on code by [Frank Macreery](http://github.com/macreery), [Artsy Inc.](http://artsy.net)
(c) 2013-2024 [Daniel Doubrovkine](http://github.com/dblock), based on code by [Frank Macreery](http://github.com/macreery), [Artsy Inc.](http://artsy.net)
File renamed without changes.
45 changes: 0 additions & 45 deletions examples/mongo_ruby_driver_scroll_feed.rb

This file was deleted.

62 changes: 0 additions & 62 deletions lib/mongo/scrollable.rb

This file was deleted.

1 change: 0 additions & 1 deletion lib/mongoid-scroll.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
require 'mongoid/criteria/scrollable/fields'
require 'mongoid/criteria/scrollable/cursors'
require 'mongoid/criteria/scrollable/iterator'
require 'mongo/scrollable' if Object.const_defined?(:Mongo)
require 'mongoid/criteria/scrollable'
2 changes: 1 addition & 1 deletion mongoid-scroll.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.homepage = 'http://github.com/mongoid/mongoid-scroll'
s.licenses = ['MIT']
s.summary = 'Mongoid extensions to enable infinite scroll.'
s.add_dependency 'mongoid', '>= 3.0'
s.add_dependency 'mongoid', '>= 6.0'
s.add_dependency 'mongoid-compatibility'
s.add_dependency 'i18n'
end
Loading

0 comments on commit 16a4f60

Please sign in to comment.