Closed
Description
- 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
Store::orderBy('_id', 'desc')->cursorPaginate(3, ['_id', 'name']);
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)Metadata
Metadata
Assignees
Labels
No labels