Execute SQL queries [SELECT] on MongoDB
- PHP 5.6
- MongoDB 3+
- Unix OS
$ pecl install mongodb
$ echo "extension=mongodb.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
$ composer self-update
$ composer install
For import test collections to Mongodb you can go to the root project folder and run following command
$ mongoimport --db test --collection restaurants --drop --file dump/dataset.json
You can run app by following steps:
- Go to project root folder
- Run php script php src/sql2mongo.php
- Enter command help
- You will see list of available commands
- How you can use these commands you can see on the screenshots
- How execute SQL query you can see on the screenshots
PS. Sorry for my English