PHP 클래스 moadminModel, nodejs-autorestart

파일 보기 프로젝트 열기: shimondoodkin/nodejs-autorestart 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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

메소드 상세

__construct() 공개 메소드

Connects to a Mongo database if the name of one is supplied as an argument
public __construct ( string $db = null )
$db string

_exec() 보호된 메소드

Executes a native JS MongoDB command This method is not currently used for anything
protected _exec ( string $cmd ) : mixed
$cmd string
리턴 mixed

_mongo() 보호된 메소드

Returns a new Mongo connection
protected _mongo ( ) : Mongo
리턴 Mongo

_unserialize() 보호된 메소드

Returns a serialized element back to its native PHP form
protected _unserialize ( string $_id, string $idtype ) : mixed
$_id string
$idtype string
리턴 mixed

createCollection() 공개 메소드

Creates a collection
public createCollection ( string $collection )
$collection string

deleteIndex() 공개 메소드

Removes an index
public deleteIndex ( string $collection, array $index )
$collection string
$index array Must match the array signature of the index

dropCollection() 공개 메소드

Drops a collection
public dropCollection ( string $collection )
$collection string

dropDb() 공개 메소드

Drops a database
public dropDb ( )

editObject() 공개 메소드

Retieves an object for editing
public editObject ( string $collection, string $_id, string $idtype ) : array
$collection string
$_id string
$idtype string
리턴 array

ensureIndex() 공개 메소드

Ensures an index
public ensureIndex ( string $collection, array $indexes, array $unique )
$collection string
$indexes array
$unique array

getStats() 공개 메소드

Generate system info and stats
public getStats ( ) : array
리턴 array

listCollections() 공개 메소드

Gets a list of database collections
public listCollections ( ) : array
리턴 array

listDbs() 공개 메소드

Gets list of databases
public listDbs ( ) : array
리턴 array

listIndexes() 공개 메소드

Gets a list of the indexes on a collection
public listIndexes ( string $collection ) : array
$collection string
리턴 array

listRows() 공개 메소드

Get the records in a collection
public listRows ( string $collection ) : array
$collection string
리턴 array

removeObject() 공개 메소드

Removes an object from a collection
public removeObject ( string $collection, string $_id, string $idtype )
$collection string
$_id string
$idtype string

repairDb() 공개 메소드

Repairs a database
public repairDb ( ) : array
리턴 array Success status

saveObject() 공개 메소드

Saves an object
public saveObject ( string $collection, string $obj ) : array
$collection string
$obj string
리턴 array

setDb() 공개 메소드

Change the DB connection
public setDb ( string $db )
$db string

프로퍼티 상세

$_db 보호되어 있는 프로퍼티

mongo connection - if a MongoDB object already exists (from a previous script) then only DB operations use this
protected Mongo $_db
리턴 Mongo

$colKeys 공개적으로 프로퍼티

Array keys in the first and last object in a collection merged together (used to build sort-by options)
public array $colKeys
리턴 array

$count 공개적으로 프로퍼티

Number of rows in the entire resultset (before limit-clause is applied)
public int $count
리턴 integer

$mongo 공개적으로 프로퍼티

MongoDB
public MongoDB $mongo
리턴 MongoDB

$sort 공개적으로 프로퍼티

Sort array - currently only used for collections
public array $sort
리턴 array

$totalDbSize 공개적으로 프로퍼티

Total size of all the databases
public int $totalDbSize
리턴 integer