Insert JSON file in PHP

Hello,

I have a JSON file and I want to load it in couchbase , can you please tell me how to do it?
Thanks
W

Hey couchbwiss,

Something like this should work!

$file_data = json_decode(file_get_contents('myfile.json'));
$bucket->upsert('key_name', $file_data);

Cheers, Brett

1 Like

Thank you @brett19 it works!
Now I would like to perform a bulk insert into the couchbase bucket witth 4000 json;
Can you please check this issue for me? Cheers