[SOLVED] Unable to get more than 14 000 records from multiple contents

I have…

  • [ ] Checked the logs and have provided uploaded a log file and provided a link because I found something suspicious there.

I’m submitting a…

  • [ ] Regression (a behavior that stopped working in a new release)
  • [X] Bug report
  • [ ] Performance issue
  • [ ] Documentation issue or request

Current behavior

If i send request for Multiple contents i can get only 14 000 last records… if i do $skip for 14000 then zero items returned.

Expected behavior

Get whole records from squidex.

Minimal reproduction of the problem

$TOTAL_IN_SQUIDEX = 21400;
$top = 13000;
$skip = 0;
$orders = 0;
for ($i = 1; $i < 111; $i++) {
    foreach ($squidex->queryOrders([
        '$top' => $top,
        '$skip' => $skip,
    ])['items'] as $order) {
        file_put_contents($fileWithIDs, $order['data']['paymentId']['iv'] . "\n", FILE_APPEND | LOCK_EX);
        echo $order['data']['paymentId']['iv'] . "<br>";
        $orders++;
    }
    $skip += $top;
    echo "request $i = $orders<br>";
}

This PHP for ends on 14 000 records (manually if i set $skip to 14000 i will get zero records)

Environment

  • [ ] Self hosted with docker
  • [ ] Self hosted with IIS
  • [ ] Self hosted with other version
  • [X] Cloud version

Version: 3.0.0.0

Browser:

  • [ ] Chrome (desktop)
  • [ ] Chrome (Android)
  • [ ] Chrome (iOS)
  • [ ] Firefox
  • [ ] Safari (desktop)
  • [ ] Safari (iOS)
  • [ ] IE
  • [ ] Edge

Others:

Do you use any sorting? The reason I ask is this restriction:

https://docs.mongodb.com/manual/reference/limits/#Sort-Operations

Without any sorting conditional.

Okay, I will have a look

Update: I can reproduce it and will very likely provide a fix today.

Great, thank you @Sebastian