PHP wrapper for CosmosDB (ex DocumentDB) operations (beta version)
- Use of the x-ms-version 2017-02-22
- PHP 7.0 mini recommended
- Enhanced unit tests
- Adding some errors throws
composer require crassaert/php-azure-documentdb
$db = new AzureDocumentDB(AZURE_HOST, AZURE_KEY, false);
$db->get('database')->_list();
$db->get('database')->create('my_database');
$db->get('database')->select('my_database');
$db->get('database')->delete('my_database');
Before requesting, you have to select a database (see previous paragraph).
$db->get('collection')->_list();
$db->get('collection')->create('my_collection');
$db->get('collection')->select('my_collection');
$db->get('collection')->delete('my_collection');
Before requesting, you have to select a database and a collection (see previous paragraph).
$db->get('document')->create($json);
Fell free to write your SQL query here.
$db->get('document')->query('SELECT * FROM my_table');
You have to select your document before removing it to obtain the internal ID.
$rid = $document->_rid;
$db->get('document')->delete($rid);
Implement permissions, triggers, users, sprocs and UDF.
You can find all features on Microsoft Azure Website