PHPackages                             pmurkin/mongo-schema-dumper - 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. [Database &amp; ORM](/categories/database)
4. /
5. pmurkin/mongo-schema-dumper

ActiveLibrary[Database &amp; ORM](/categories/database)

pmurkin/mongo-schema-dumper
===========================

12.0kPHP

Since Sep 29Pushed 7y ago1 watchersCompare

[ Source](https://github.com/kot13/mongo-schema-dumper)[ Packagist](https://packagist.org/packages/pmurkin/mongo-schema-dumper)[ RSS](/packages/pmurkin-mongo-schema-dumper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5aa92a640f9cf014160e2664d645677530bfe3533684a4dcc851e5b77f1e262e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6b6f7431332f6d6f6e676f2d736368656d612d64756d7065722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/kot13/mongo-schema-dumper/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/d54772e3566561a21b3b5a8af8fe70faf1c574a2b2e2a706bde6089d0a2814b9/68747470733a2f2f706f7365722e707567782e6f72672f706d75726b696e2f6d6f6e676f2d736368656d612d64756d7065722f646f776e6c6f616473)](https://packagist.org/packages/pmurkin/mongo-schema-dumper)[![License](https://camo.githubusercontent.com/9698c84514871b517608787d687e706e8ae9a8947485b6d26d972d9ed31e0949/68747470733a2f2f706f7365722e707567782e6f72672f706d75726b696e2f6d6f6e676f2d736368656d612d64756d7065722f6c6963656e7365)](https://packagist.org/packages/mongo-schema-dumper/bootstrapi)

Mongo Schema Dumper for Laravel
===============================

[](#mongo-schema-dumper-for-laravel)

Import and export mongodb schema without copying all the data:

- Collections
- Indexes
- Cap sizes

Also you can dump all data from required collections.

This primary use case is when you have developed an application that uses mongodb, and want to setup a new instance with database layout. You can run the console command and create json file with you databases schema looks like something this:

```
{
    "data": {
        "products": {
            "indexes": [
                {
                    "name": "_id_",
                    "ns": "data.products",
                    "key": {
                        "_id": 1
                    },
                    "v": 2
                }
            ],
            "options": []
        },
        "users: {
            "indexes": [
                {
                    "name": "_id_",
                    "ns": "data.users",
                    "key": {
                        "_id": 1
                    },
                    "v": 2
                }
            ],
            "options": [],
            "data": [
                {
                    "_id": "5858d847e632ed712a9f5c04",
                    "name": "admin"
                },
                {
                    "_id": "5858d872e632ed712a9f5c05",
                    "name": "manager"
                }
            ]
        }
    }
}

```

After that you can run the console commands to import the schema into the database.

Install
-------

[](#install)

Require this package with composer using the following command:

```
$ composer require pmurkin/mongo-schema-dumper

```

After updating composer, add the service provider to the providers array in config/app.php

```
Pmurkin\MongoSchemaDumper\MongoSchemaDumperServiceProvider::class,

```

Usage
-----

[](#usage)

Export schema to file:

```
$ php artisan schema:export --databases=data,users --dump=users.roles --file=./schema.json

```

databases - list of databases for export

dump - list of collections for dump

file - file for save (not required, by default - ./schema.json)

Import schema from file:

```
$ php artisan schema:import --file=./schema.json

```

file - file for save (not required, by default - ./schema.json)

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

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/eb151be47027334b317394c563c9d1577cf57dc465f8c1ab0318ec30c58a5f48?d=identicon)[pmurkin](/maintainers/pmurkin)

---

Tags

exportimportlaravelmongodb

### Embed Badge

![Health badge](/badges/pmurkin-mongo-schema-dumper/health.svg)

```
[![Health](https://phpackages.com/badges/pmurkin-mongo-schema-dumper/health.svg)](https://phpackages.com/packages/pmurkin-mongo-schema-dumper)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.3k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M543](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M209](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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