PHP code example of dovstone / mynosql

1. Go to this page and download the library: Download dovstone/mynosql library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dovstone / mynosql example snippets




use DovStone\MyNoSQL\HostConnection;

$db = new HostConnection('mysql:host=localhost;dbname=mynosql', $user='root', $password='');

$document  = $db->collection(collection_name)->insert(array $document);

$documents = $db->collection(collection_name)->findBy(array $criteria, array $orderBy, int $limit, int $offset)->fetch();

$documents = $db->collection(collection_name)->findAllBy(array $criteria, array $orderBy)->fetch();

$data = $db->collection(collection_name)->findBy(array $criteria)->orderBy(array $orderBy)->limit(int $limit)->offset(int $offset);

$data = $db->collection(collection_name)->findAllBy(array $criteria)->orderBy(array $orderBy);

$documents = $db->collection(collection_name)->findBy(array $criteria)->orderBy(array $orderBy)->limit(int $limit)->offset(int $offset)->fetch();

$documents = $db->collection(collection_name)->findAllBy(array $criteria)->orderBy(array $orderBy)->fetch();

$data = $db->collection(collection_name)->findAllBy(array $criteria)->orderBy(array $orderBy);

$data->getSQLData()

$data->getSQL()

$data->getSQLParams()