MongoRegex::__construct

(PECL mongo >= 0.8.1) Creates a new regular expression public MongoRegex::__construct ( string $regex ) Creates a new regular expression. Parameters: regex Regular expression string of the form /expr/flags. Returns: Returns a new regular expression. Examples: MongoRegex::__construc

MongoDate::__toString

(PECL mongo >= 0.8.1) Returns a string representation of this date public string MongoDate::__toString ( void ) Returns a string representation of this date, similar to the representation returned by microtime(). Returns: This date.

MongoDate::toDateTime

(PECL mongo >= 1.6.0; PHP > 5.3.4) Returns a DateTime object representing this date public DateTime MongoDate::toDateTime ( void ) Returns a DateTime object representation of this date. Returns: This date as a DateTime object. Examples: MongoDate::toDateTime() example This example demonstrates creating a DateTime obje

MongoDate::__construct

(PECL mongo >= 0.8.1) Creates a new date. public MongoDate::__construct ([ int $sec = time() [, int $usec = 0 ]] ) Creates a new date. If no parameters are given, the current time is used. Parameters: sec Number of seconds since the epoch (i.e. 1 Jan 1970 00:00:00.000 UTC). usec Microseconds. Please be aware though that MongoDB's r

MongoCode::__toString

(PECL mongo >= 0.8.3) Returns this code as a string public string MongoCode::__toString ( void ) Returns: This code, the scope is not returned. Examples: MongoCode::__toString() example <?php $code = new MongoCode('return x;', array("x"=>"hi")); echo "$code\n"; $code = new MongoCode('function() { for(i=0;i<10;

MongoCode::__construct

(PECL mongo >= 0.8.3) Creates a new code object public MongoCode::__construct ( string $code [, array $scope = array() ] ) Parameters: code A string of code. scope The scope to use for the code. Returns: Returns a new code object. Examples: MongoC

MongoId::__toString

(PECL mongo >= 0.8.0) Returns a hexidecimal representation of this id public string MongoId::__toString ( void ) Returns: This id. Examples: MongoId::__toString() example <?php $m = new MongoClient(); $collection = $m->selectDB("foo")->selectCollection("bar"); $collection->insert(array( "x" => "y" )); $c

MongoId::__set_state

(PECL mongo >= 1.0.8) Create a dummy MongoId public static MongoId MongoId::__set_state ( array $props ) This function is only used by PHP internally, it shouldn't need to ever be called by the user. It is identical to the function: <?php public static function __set_state($props) {     return new MongoId("000000000000000000000000"); } ?> Parameters: props

MongoId::isValid

(PECL mongo >= 1.5.0) Check if a value is a valid ObjectId public static bool MongoId::isValid ( mixed $value ) This method may be used to check a variable before passing it as an argument to MongoId::__construct(). Parameters: value The value to check for validity. Returns: Returns TRUE if value is a MongoId instance or a string consisting of

MongoId::getTimestamp

(PECL mongo >= 1.0.1) Gets the number of seconds since the epoch that this id was created public int MongoId::getTimestamp ( void ) This returns the same thing as running time() when the id is created. Returns: Returns the number of seconds since the epoch that this id was created. There are only four bytes of timestamp stored, so MongoDate is a better choice for storing exact or wide-ranging t