1234567891011121314 |
- <?php
- require_once("../../../mdb/vendor/autoload.php");
- use MongoDB\BSON\ObjectId;
- use MongoDB\Client;
- // Requires the MongoDB PHP Driver
- // https://www.mongodb.com/docs/drivers/php/
- $client = new Client('mongodb://kpadmin:AnandAyyappan1981@127.0.0.1:27017/?authSource=kpmaster');
- $collection = $client->selectCollection('kpmaster', 'kpu');
- $return = $collection->updateOne(['_id' => new ObjectId('64b0f61b8b3742ad72109e80')], ['$set' => ['location' => ['coordinates' => [76.7682501,8.73673601],'type'=> "Point"]]]);
- printf("Matched %d document(s)\n", $return->getMatchedCount());
- printf("Modified %d document(s)\n", $return->getModifiedCount());
- ?>
|