Skip to content

cursorPaginate is not working #2408

Closed
Closed
@hnccox

Description

@hnccox
  • 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions