Skip to content

Issue using chunk with limit #9649

Closed
Closed
@kidtronnix

Description

@kidtronnix

I am trying to design an endpoint that has a streamed response for returning large JSON results. I am wanting to add a limit query paramater. But it appears to have no effect when used with chunk()

For example this doesn't work. The limit simply has no effect:

$users = Users::select();
$users->skip(0);
$users->take(1);

$users->chunk(1, function($u) {
    print_r($u);
});

But this does:

$users = Users::select();
$users->skip(0);
$users->take(1);
print_r($users->get())

Please any help would be massively appreciated.

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