dreamfactory/azure-documentdb-php-sdk
最新稳定版本:0.2.1
Composer 安装命令:
composer require dreamfactory/azure-documentdb-php-sdk
包简介
A simple PHP SDK for Microsoft Azure DocumentDB.
README 文档
README
PHP SDK for Azure DocumentDB
Usage
$client = new DreamFactory\DocumentDb\Client('azure_host_uri', 'azure_document_db_key');
$db = new \DreamFactory\DocumentDb\Resources\Database($client);
$db->getAll()
$db->get('db-id');
$db->create(['id'=>'my_db']);
$db->delete('db-id');
//To set additional optional headers
$db->setHeaders(['Content-Type: application/json']);
$coll = new \DreamFactory\DocumentDb\Resources\Collection($client, 'db-id');
$coll->getAll();
$coll->get('coll-id');
$coll->create(['id'=>'1']);
$coll->replace(['id'=>'1', 'indexingPolicy'=>[...]], 'coll-id');
$coll->delete('coll-id');
//To set additional optional headers
$coll->setHeaders(['Content-Type: application/json']);
$doc = new \DreamFactory\DocumentDb\Resources\Document($client, 'db-id', 'coll-id');
$doc->getAll();
$doc->get('doc-id');
$doc->create(['id'=>'1', 'name'=>'foobar']);
$doc->replace(['id'=>'1', 'name'=>'foobar-replaced'], 'doc-1');
$doc->query('SELECT * FROM coll WHERE coll.name = @name', [['name' => '@name', 'value' => 'foobar']]);
$doc->delete('doc-id');
//To set additional optional headers
$doc->setHeaders(['Content-Type: application/json']);
Note
Only Database, Collection, and Document operations are supported now.
统计信息
- 总下载量: 184.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 未知