PHPackages                             crassaert/php-azure-documentdb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. crassaert/php-azure-documentdb

ActiveLibrary[API Development](/categories/api)

crassaert/php-azure-documentdb
==============================

PHP wrapper to query Microsoft Azure DocumentDB REST API

v1.1(8y ago)1010.0k—0%6[2 issues](https://github.com/crassaert/php-azure-documentdb/issues)GPL-3.0PHP

Since Apr 20Pushed 7y ago3 watchersCompare

[ Source](https://github.com/crassaert/php-azure-documentdb)[ Packagist](https://packagist.org/packages/crassaert/php-azure-documentdb)[ RSS](/packages/crassaert-php-azure-documentdb/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

php-azure-documentdb
====================

[](#php-azure-documentdb)

PHP wrapper for CosmosDB (ex DocumentDB) operations (beta version)

Update January 2018 v1.1
------------------------

[](#update-january-2018-v11)

- Use of the x-ms-version 2017-02-22
- PHP 7.0 mini recommended
- Enhanced unit tests
- Adding some errors throws

Usage
=====

[](#usage)

Install
-------

[](#install)

`composer require crassaert/php-azure-documentdb`

Instantiate
-----------

[](#instantiate)

`$db = new AzureDocumentDB(AZURE_HOST, AZURE_KEY, false);`

Databases operation
-------------------

[](#databases-operation)

### List

[](#list)

`$db->get('database')->_list();`

### Creation

[](#creation)

`$db->get('database')->create('my_database');`

### Selection

[](#selection)

`$db->get('database')->select('my_database');`

### Remove

[](#remove)

`$db->get('database')->delete('my_database');`

Collections
-----------

[](#collections)

Before requesting, you have to select a database (see previous paragraph).

### List

[](#list-1)

`$db->get('collection')->_list();`

### Creation

[](#creation-1)

`$db->get('collection')->create('my_collection');`

### Selection

[](#selection-1)

`$db->get('collection')->select('my_collection');`

### Remove

[](#remove-1)

`$db->get('collection')->delete('my_collection');`

Document
--------

[](#document)

Before requesting, you have to select a database and a collection (see previous paragraph).

### Creation

[](#creation-2)

`$db->get('document')->create($json);`

### Requesting

[](#requesting)

Fell free to write your SQL query here.

`$db->get('document')->query('SELECT * FROM my_table');`

### Remove

[](#remove-2)

You have to select your document before removing it to obtain the internal ID.

```
$rid = $document->_rid;
$db->get('document')->delete($rid);

```

TODO
----

[](#todo)

Implement permissions, triggers, users, sprocs and UDF.

You can find all features on [Microsoft Azure Website](https://msdn.microsoft.com/fr-fr/library/azure/dn781481.aspx)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 84.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~263 days

Total

2

Last Release

3052d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4562b49a0e91521dbace4dd691fd68b4a928c7edc1616acd67a5f66d125aaa95?d=identicon)[crassaert](/maintainers/crassaert)

---

Top Contributors

[![crassaert](https://avatars.githubusercontent.com/u/6930172?v=4)](https://github.com/crassaert "crassaert (16 commits)")[![glenndehaan](https://avatars.githubusercontent.com/u/7496187?v=4)](https://github.com/glenndehaan "glenndehaan (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/crassaert-php-azure-documentdb/health.svg)

```
[![Health](https://phpackages.com/badges/crassaert-php-azure-documentdb/health.svg)](https://phpackages.com/packages/crassaert-php-azure-documentdb)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

265103.1M454](/packages/google-gax)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
