I'm trying to list all the documents I have inside a MongoDB collection, but I keep receiving this error:
MongoDB\Driver\Exception\InvalidArgumentException: Integer overflow detected on your platform: 1000000000 in (...):16 Stack trace: #0 {main}
I think that I'm receiving this error because the following value is too big to be an integer.
My code:
try {
$mongo = new MongoDB\Driver\Manager('...');
$query = new MongoDB\Driver\Query([]);
$rows = $mongo->executeQuery('..', $query);
echo json_encode(iterator_to_array($rows));
} catch (MongoDB\Driver\Exception\Exception $e) {
echo $e;
}
How can I solve this issue?
Thank you.