Свойство | Type | Description | |
---|---|---|---|
$colKeys | array | Array keys in the first and last object in a collection merged together (used to build sort-by options) | |
$count | integer | Number of rows in the entire resultset (before limit-clause is applied) | |
$mongo | MongoDB | MongoDB | |
$sort | array | Sort array - currently only used for collections | |
$totalDbSize | integer | Total size of all the databases |
Свойство | Type | Description | |
---|---|---|---|
$_db | Mongo | mongo connection - if a MongoDB object already exists (from a previous script) then only DB operations use this |
Méthode | Description | |
---|---|---|
__construct ( string $db = null ) | Connects to a Mongo database if the name of one is supplied as an argument | |
createCollection ( string $collection ) | Creates a collection | |
deleteIndex ( string $collection, array $index ) | Removes an index | |
dropCollection ( string $collection ) | Drops a collection | |
dropDb ( ) | Drops a database | |
editObject ( string $collection, string $_id, string $idtype ) : array | Retieves an object for editing | |
ensureIndex ( string $collection, array $indexes, array $unique ) | Ensures an index | |
getStats ( ) : array | Generate system info and stats | |
listCollections ( ) : array | Gets a list of database collections | |
listDbs ( ) : array | Gets list of databases | |
listIndexes ( string $collection ) : array | Gets a list of the indexes on a collection | |
listRows ( string $collection ) : array | Get the records in a collection | |
removeObject ( string $collection, string $_id, string $idtype ) | Removes an object from a collection | |
repairDb ( ) : array | Repairs a database | |
saveObject ( string $collection, string $obj ) : array | Saves an object | |
setDb ( string $db ) | Change the DB connection |
Méthode | Description | |
---|---|---|
_exec ( string $cmd ) : mixed | Executes a native JS MongoDB command This method is not currently used for anything | |
_mongo ( ) : Mongo | Returns a new Mongo connection | |
_unserialize ( string $_id, string $idtype ) : mixed | Returns a serialized element back to its native PHP form |
public __construct ( string $db = null ) | ||
$db | string |
protected _mongo ( ) : Mongo | ||
Résultat | Mongo |
public createCollection ( string $collection ) | ||
$collection | string |
public deleteIndex ( string $collection, array $index ) | ||
$collection | string | |
$index | array | Must match the array signature of the index |
public dropCollection ( string $collection ) | ||
$collection | string |
public listCollections ( ) : array | ||
Résultat | array |
public listIndexes ( string $collection ) : array | ||
$collection | string | |
Résultat | array |
protected Mongo $_db | ||
Résultat | Mongo |
public array $colKeys | ||
Résultat | array |
public int $count | ||
Résultat | integer |
public array $sort | ||
Résultat | array |
public int $totalDbSize | ||
Résultat | integer |