MongoLite - NoSql implemented in Php (+Sqlite)
I needed a NoSql solution for small projects without the need of a full MongoDb server.
This is the result:
$client = new MongoLite\Client(PATH_TO_WRITABLE_FOLDER);
$database = $client->testdb;
$collection = $database->products;
$entry = ["name"=>"Super cool Product", "price"=>20];
$collection->insert($entry);
$products = $collection->find(); // Get Cursor
if ($products->count()) {
foreach($products->sort(["price"=>1])->limit(5) as $product) {
var_dump($product);
}
}
More information + SourceCode: https://github.com/aheinze/MongoLite
Greets,
Artur
Written by Artur
Related protips
1 Response
Artur, thanks for sharing. Congratulations on your achievement! Great idea with this implementation.
All the best to you.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#