Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cursorPaginate is not working #2408

Closed
hnccox opened this issue Jun 29, 2022 · 4 comments
Closed

cursorPaginate is not working #2408

hnccox opened this issue Jun 29, 2022 · 4 comments

Comments

@hnccox
Copy link

hnccox commented Jun 29, 2022

  • Laravel-mongodb Version: ^3.9
  • PHP Version: 8.1.6
  • Database Driver & Version: 5.0.9

Description:

When trying to use the cursorPaginate method, it only works when the integer is equal to or higher than the total count of documents in the collection.

When I have 3 documents in my stores collection, I have to use cursorPaginate(3) in order for it to return the results.

Any integer lower than the total document count results in an error.

Steps to reproduce

  1. Store::orderBy('_id', 'desc')->cursorPaginate(3, ['_id', 'name']);
  2. Store::orderBy('_id', 'desc')->cursorPaginate(2, ['_id', 'name']);

Expected behaviour

When using cursorPaginate(2) I would expect it to return 2 results and have a next_cursor value.

Actual behaviour

I receive the following error message:
"array_flip(): Can only flip string and integer values, entry skipped"

Logs: Insert log.txt here (if necessary)
@leon0399
Copy link

Can confirm! I've found previous issue, and it was marked as implemented: #2312

But it still does not work

@divine
Copy link
Contributor

divine commented Jun 29, 2022

Hello,

Sorry, can't release a new version. Follow up here #2365

Thanks!

@divine divine closed this as completed Jun 29, 2022
@leon0399
Copy link

@divine so there is no reason to close issue, until it is fixed. Please keep it open, until fix is released

@divine divine reopened this Jun 29, 2022
@divine
Copy link
Contributor

divine commented Jun 30, 2022

Hello,

The new version was published.

Thanks!

@divine divine closed this as completed Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants