PHPackages                             abishekrsrikaanth/mongohq-api - 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. abishekrsrikaanth/mongohq-api

ActiveLibrary[API Development](/categories/api)

abishekrsrikaanth/mongohq-api
=============================

Laravel 4 Integration for MongoHQ API

118PHP

Since Oct 13Pushed 12y ago1 watchersCompare

[ Source](https://github.com/abishekrsrikaanth/mongohq-api-laravel4)[ Packagist](https://packagist.org/packages/abishekrsrikaanth/mongohq-api)[ RSS](/packages/abishekrsrikaanth-mongohq-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

\##Laravel 4 Integration for MongoHQ API

[![Bitdeli Badge](https://camo.githubusercontent.com/7581c64d21ee8cdb1c23f65a43d982ed4d30533a6defd5909d852287eec9ad60/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f6162697368656b727372696b61616e74682f6d6f6e676f68712d6170692d6c61726176656c342f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")[![endorse](https://camo.githubusercontent.com/e2e1f38d1c4438e68411ba9aaa6370eb04eac2279a531b9407123c8db346dd93/68747470733a2f2f6170692e636f64657277616c6c2e636f6d2f6162697368656b727372696b61616e74682f656e646f727365636f756e742e706e67)](https://coderwall.com/abishekrsrikaanth)

- [Installation](#install)
- [Usage](#usage)
- [Database](#database)
    - [List Databases](#list-db)
    - [Create Database](#create-db)
    - [Get DB Info](#info-db)
    - [Drop DB](#drop-db)
- [Collections](#collections)
    - [List Collections](#list-coll)
    - [Create Collection](#create-coll)
    - [Collection Stats](#stats-coll)
    - [Rename Collection](#rename-coll)
    - [Drop Collection](#drop-coll)
- [Indexes](#indexes)
    - [List Indexes](#list-idx)
    - [Create Index](#create-idx)
    - [Drop Index](#drop-idx)
    - [Drop All Collection Indexes](#drop-idx-all)
- [Users](#users)
    - [Create User](#create-user)

\###Installation Add abishekrsrikaanth/mongohq-api as a requirement to composer.json:

```
{
    ...
    "require": {
        ...
        "abishekrsrikaanth/mongohq-api": "dev-master"
        ...
    },
}

```

Update composer:

```
$ php composer.phar update

```

Add the provider to your app/config/app.php:

```
'providers' => array(
    ...
    'Abishekrsrikaanth\MongohqApi\MongohqApiServiceProvider',
),

```

and the Facade info on app/config/app.php

```
'aliases'   => array(
    ...
    'MongoHQ'     => 'Abishekrsrikaanth\MongohqApi\Facades\MongohqApi',
),

```

Publish the Configuration and setup the API Key

```
php artisan config:publish abishekrsrikaanth/mongohq-api

```

---

\###Usage

***Initializing the database Object***

If the MongoHQ API Key is configured on the [config file published](#config-publish)

```
$db = MongoHQ::Database();

```

To pass the MongoHQ API Key dynamically

```
$db = MongoHQ::Database('API_KEY_GOES_HERE')

```

***Initializing the Collections Object***

If the MongoHQ API Key is configured on the [config file published](#config-publish)

```
$coll = MongoHQ::Collections();

```

To pass the MongoHQ API Key dynamically

```
$coll = MongoHQ::Collections('API_KEY_GOES_HERE')

```

***Initializing the Indexes Object***

If the MongoHQ API Key is configured on the [config file published](#config-publish)

```
$idx = MongoHQ::Indexes();

```

***Initializing the Users Object***

If the MongoHQ API Key is configured on the [config file published](#config-publish)

```
$idx = MongoHQ::Users();

```

To pass the MongoHQ API Key dynamically

```
$idx = MongoHQ::Indexes('API_KEY_GOES_HERE')

```

The API Key can be passed to all the initializations mentioned above

---

\###Database

\####Getting the list of databases

```
$db = MongoHQ::Database(); //Initializes the Database Class
$db->get();

```

\####Create Database

```
$db = MongoHQ::Database();
$db->create('DB_NAME','PLAN_TO_USE');

```

\####Get DB Info

```
$db = MongoHQ::Database();
$db->info('DB_NAME_TO_GET_THE_INFO');

```

\####Drop a Database

```
$db = MongoHQ::Database();
$db->drop('DB_NAME_TO_GET_THE_INFO');

```

---

\###Collections

\####Getting the list of collections

```
$coll = MongoHQ::Collections(); //Initializes the Database Class
$coll->get('DB_NAME_TO_GET_THE_LIST_COLLECTIONS');

```

\####Create a Collection

```
$coll = MongoHQ::Collections();
$coll->create('DB_NAME_TO_CREATE_THE_COLLECTION_ON','COLLECTION_NAME');

```

\####Getting the Collection Stats

```
$coll = MongoHQ::Collections();
$coll->stats('DB_NAME','COLLECTION_NAME_TO_GET_STATS');

```

\####Rename Collection

```
$coll = MongoHQ::Collections();
$coll->rename('DB_NAME','OLD_COLLECTION_NAME','NEW_COLLECTION_NAME');

```

\####Drop a Collection from a Database

```
$coll = MongoHQ::Collections();
$coll->drop('DB_NAME','COLLECTION_NAME_TO_DROP');

```

---

\###Indexes

\####Getting the list of indexes on a Collection

```
$idx = MongoHQ::Indexes(); //Initializes the Database Class
$idx->get('DB_NAME','COLLECTION_NAME');

```

\####Create an Index on a Collection

```
$idx = MongoHQ::Indexes();
$idx->create('DB_NAME','COLLECTION_NAME',
    array('name'=>'1'),  //IDX_SPEC - The index spec to be created. (i.e. {name:1})
    array(
        'background' => true, //Indicate that the index should be built in the background. (defaults to true)
        'unique'     => false, //If true, this index will enforce a uniqueness constraint. (defaults to false)
        'drop_dups'  => false, //If creating a unique index on a collection with pre-existing records,
                             //this option will keep the first document the database
                             //indexes and drop all subsequent with duplicate values. (defaults to false)
        'min'        => null, //Specify the minimum longitude and latitude for a geo index. (defaults to null)
        'max'        => null //Specify the maximum longitude and latitude for a geo index. (defaults to null)
        )
    );

```

\####Drop an Index on a Collection

```
$idx = MongoHQ::Indexes();
$idx->drop('DB_NAME','COLLECTION_NAME','IDX_NAME');

```

\####Drop all Indexes on the Collection

```
$idx = MongoHQ::Indexes();
$idx->dropAll('DB_NAME','COLLECTION_NAME');

```

---

\###Users

\####Creating a User on a DB on MongoHQ

```
$userObj = MongoHQ::Users(); //Initializes the Database Class
$userObj->create('DB_NAME','USER_NAME','PASSWORD');

```

The create function will internally manage the hashing of the password as required by MongoDB.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/679089de897a6d3f79d14628be0e3a38b3d77ccfa7c1f85ca7de06ae7564b166?d=identicon)[abishekrsrikaanth](/maintainers/abishekrsrikaanth)

---

Top Contributors

[![abishekrsrikaanth](https://avatars.githubusercontent.com/u/1639302?v=4)](https://github.com/abishekrsrikaanth "abishekrsrikaanth (22 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

### Embed Badge

![Health badge](/badges/abishekrsrikaanth-mongohq-api/health.svg)

```
[![Health](https://phpackages.com/badges/abishekrsrikaanth-mongohq-api/health.svg)](https://phpackages.com/packages/abishekrsrikaanth-mongohq-api)
```

###  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)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

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

PHP wrapper for the Meilisearch API

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

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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