PHP Mongodb Indexing:
It is not so hard to make index in Bigdata database such like MongoDB. Take look following bellow.
It is not so hard to make index in Bigdata database such like MongoDB. Take look following bellow.
<?php $c = new MongoCollection($db, 'foo'); // Create an index on 'A' ascending $AscIndex = array('A' => 1); $c->createIndex($AscIndex); // Create an index on 'A' descending $DscIndex = array('A' => -1); $c->createIndex($DscIndex); // Create a unique index on 'a_row_index' $a_row_index = array('a_row_index' => 1), array('unique' => true); $cIndex -> createIndex($a_row_index); // create a compound index on 'XY' ascending and 'YX' descending $XyYx = array('XY' => 1, 'YX' => -1); $cIndex -> createIndex($XyYx); ?>
MongoDB indexing in PHP
By Game Changer →
Thursday, February 25, 2016