1

I'm getting error when i try indexing my document using laravel.

This is my main code. By using die statements, I came to know that i'm getting this error "[MongoDB\Driver\Exception\InvalidArgumentException] Integer overflow detected on your platform: 300000000000" as soon as it executes first line : $users = User::all();

$users = User::all();
foreach ($users as $user) {
        $temp=$user['attributes']; 
        unset($temp['_id']);
             $params = [
              'index' => 'test_index',
              'type' => $temp['vehicle_type'],
          'id' => $temp['lid'],
          'body' => $temp
        ];
        print_r($params); die;
     $response = $client->index($params);
     set_time_limit(100);
 }
    }``

I am using https://github.com/jenssegers/laravel-mongodb to interface Laravel and mongoDB. My User model looks like this

use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
class User extends Eloquent 
{
    protected $connection = 'mongodb';
    protected $collection = 'Test4';  
}

Test4 contains big data. However, i've made sure i don't have any integer in my mapping that might cause integer overflow error. Kindly help me out. I am new to Laravel and MongoDB I would be happy to provide any further info that might be required.

Also when i try to decrease No. of fields in mapping and indexing, i get this error " PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40 bytes) in C:\xampp\htdocs\ProTest1\vendor\jenssegers\mongodb\src\Jenssegers\Mongodb\Query\Builder.php on line 392"

4

1 に答える 1