프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$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 |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_db | Mongo | mongo connection - if a MongoDB object already exists (from a previous script) then only DB operations use this |
메소드 | 설명 | |
---|---|---|
__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 |
메소드 | 설명 | |
---|---|---|
_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 |
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 | ||
리턴 | array |
public listIndexes ( string $collection ) : array | ||
$collection | string | |
리턴 | array |
protected Mongo $_db | ||
리턴 | Mongo |
public array $colKeys | ||
리턴 | array |
public int $count | ||
리턴 | integer |