Download the PHP package deerdama/laravel-mongo-helper without Composer

On this page you can find all versions of the php package deerdama/laravel-mongo-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-mongo-helper

Mongodb Helper for Laravel

Artisan command to quickly check, delete, export mongo collections, and to import data.

Install package: composer require deerdama/laravel-mongo-helper.

Should work on any laravel above 5.0, I can personally confirm 5.8, 6.x, 7.x, 8.x. Feel free to let me know if you find out issues on other versions, and I'll update the info..



Available Parameters

Option Value Description
connection string Use a specific connection name instead of the default
count Output the total of matching records found in the specified collection
count_all Shows a table with all existing collections and their totals
csv ** Adding the option will export the data as csv (default is json)
delete Delete the entire content or the matching results from the collection
desc Make the sorting descending (requires --sort option)
download ** Export the results into a file
download_path ** string Download the file into a specific directory (will ignore the default config directory)
drop Completely drop the collection
dump Simply dump() the results as they are
import ** string Import into a collection data exported as json or csv
limit int When using some data retrieval method, limit the amount of results returned
list Output all existing collections
select array Retrieve only specific columns
sort string Field to use for sorting
update ** string Field to use for sorting
where ** string Where parameters


Config

:exclamation: If you'll need to change the default config then you'll need to publish it first: php artisan vendor:publish --provider=Deerdama\\MongoHelper\\MongoHelperServiceProvider

After publishing the package you can edit the config in config/mongo_helper.php. All parameters can be changed

!!Passing a specific cast in the parameter will always overwrite the autocasts.



Basic Usage

Simply run the artisan command db:mongo-helper and add the correct option based on what you need, some options require a value, details about all of them can be found in the Available Parameters table.

All fatal options (delete, drop...) will ask for an extra confirmation before being executed.

Couple of simple examples



Using WHERE conditions

php artisan db:mongo-helper test_collection --where="name, IN, [xyz,abc]" --where="id, BETWEEN, [5,99]" --where="deleted_at, NULL"



Download Collections



Import Data



Update Data

Eg. update pet and year for specific records in users collection:


All versions of laravel-mongo-helper with dependencies

PHP Build Version
Package Version
Requires jenssegers/mongodb Version ^3.1 || ^4.0
deerdama/console-zoo-laravel Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package deerdama/laravel-mongo-helper contains the following files

Loading the files please wait ....