Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
GCorbel and dblock authored Aug 29, 2024
1 parent 9c20b52 commit aa019aa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ end
Loop over the first records again.

```ruby
Feed::Item.desc(:position).limit(5).scroll(saved_previous_cursor) do |record, iterator|
Feed::Item.desc(:position).limit(5).scroll(saved_iterator.previous_cursor) do |record, iterator|
# each record, one-by-one
saved_iterator = iterator
end
Expand Down Expand Up @@ -119,7 +119,7 @@ end
Resume iterating using the previously saved cursor.

```ruby
session[:feed_items].find.sort(position: -1).limit(5).scroll(iterator.next_cursor, { field_type: DateTime }) do |record, iterator|
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
Expand Down
2 changes: 1 addition & 1 deletion UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Upgrading to >= 2.0.0

The second argument passed to the block in `Mongoid::Criteria::Scrollable#scroll` and `Mongo::Scrollable#scroll` has changed. It is now an instance of `Mongoid::Criteria::Scrollable` that provides two methods: `next_cursor` and `previous_cursor`. The `next_cursor` method returns the same cursor as in versions prior to 2.0.0.
The second argument yielded in the block in `Mongoid::Criteria::Scrollable#scroll` and `Mongo::Scrollable#scroll` has changed from a cursor to an instance of `Mongoid::Criteria::Scrollable` which provides `next_cursor` and `previous_cursor`. The `next_cursor` method returns the same cursor as in versions prior to 2.0.0.

For example, this code:

Expand Down

0 comments on commit aa019aa

Please sign in to comment.