Giter Club home page Giter Club logo

mongo_sql's Introduction

MongoDB SQL Client

This test application provide feature to use SQL SELECT operator with MongoDB.

Requirements

Installation

$ composer install

Above command install dependencies and prepare environment for testing.

To configure MongoDB connection you need to rename app/config/config.yml.dist to app/config/config.yml and put into this file your credentials:

mongodb:
    username: '[username]'
    password: '[password]'
    host:     'localhost'
    port:     27017
    database: '[database]'

Usage

# From project root execute command
$ php mongo-sql

# Get data from collection
> SELECT * FROM collection_name;

# Select specific fields(templates: *, field, field.subfield, field.*) separated by commas
> SELECT field FROM collection_name;

# Use WHERE condition to extract only those records that fulfill a specified condition
> SELECT field FROM collection_name WHERE size > 10;

# Sort result
> SELECT field FROM collection_name ORDER BY age DESC, name;

# Use SKIP to control where MongoDB begins returning results
> SELECT field FROM collection_name SKIP 3;

# Use LIMIT to specify the maximum number of documents the cursor will return.
> SELECT field FROM collection_name LIMIT 5;

Dependencies

  • mongodb: MongoDB driver library
  • php-di: Dependency Injection Container for PHP
  • yaml: Symfony Yaml Component for pretty config files

Dev Dependencies

  • phpunit: Testing framework for PHP

Tests

$ phpunit

mongo_sql's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.