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 5fc1fa6
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 326 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: 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
29 changes: 2 additions & 27 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,7 +22,7 @@ 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

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.

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
186 changes: 0 additions & 186 deletions spec/mongo/collection_view_spec.rb

This file was deleted.

0 comments on commit 5fc1fa6

Please sign in to comment.