MongoGridFSCursor::__construct

(PECL mongo >=0.9.0) Create a new cursor public MongoGridFSCursor::__construct ( MongoGridFS $gridfs, resource $connection, string $ns, array $query, array $fields ) Parameters: gridfs Related GridFS collection. connection Database connection. ns Full name of database and collection.

MongoGridFSCursor::key

(PECL mongo >=0.9.0) Returns the current result's filename public string MongoGridFSCursor::key ( void ) Returns: The current result's _id as a string. Changelog: 1.3.0 The document's _id is returned as a string value, since the key should be unique. Pre-1.3.0, filename was returned.

MongoGridfsFile::__construct

(PECL mongo >=0.9.0) Create a new GridFS file public MongoGridfsFile::__construct ( MongoGridFS $gridfs, array $file ) Parameters: gridfs The parent MongoGridFS instance. file A file from the database. Returns: Returns a new MongoGridFSFile.

MongoGridFS::storeFile

(PECL mongo >=0.9.0) Stores a file in the database public mixed MongoGridFS::storeFile ( string|resource $filename [, array $metadata = array() [, array $options = array() ]] ) Parameters: filename Name of the file or a readable stream to store. metadata Other metadata fields to include in the file document. Note: These fields ma

MongoGridFS::storeUpload

(PECL mongo >=0.9.0) Stores an uploaded file in the database public mixed MongoGridFS::storeUpload ( string $name [, array $metadata ] ) Parameters: name The name of the uploaded file(s) to store. This should correspond to the file field's name attribute in the HTML form. metadata Other metadata fields to include in the file document.

MongoGridFSFile::getResource

(PECL mongo >=1.3.0) Returns a resource that can be used to read the stored file public resource MongoGridFSFile::getResource ( void ) This method returns a stream resource that can be used with all file functions in PHP that deal with reading files. The contents of the file are pulled out of MongoDB on the fly, so that the whole file does not have to be loaded into memory first. At most two GridFSFile chunks will be lo

MongoGridFSFile::getBytes

(PECL mongo >=0.9.0) Returns this file's contents as a string of bytes public string MongoGridFSFile::getBytes ( void ) Warning: this will load the file into memory. If the file is bigger than your memory, this will cause problems! Returns: Returns a string of the bytes in the file. Examples: MongoGridFSFile::getBytes() example

MongoGridFSFile::getSize

(PECL mongo >=0.9.0) Returns this file's size public int MongoGridFSFile::getSize ( void ) Returns: Returns this file's size

MongoGridFSFile::getFilename

(PECL mongo >=0.9.0) Returns this file's filename public string MongoGridFSFile::getFilename ( void ) Returns: Returns the filename.

MongoGridFS::delete

(PECL mongo >=1.0.8) Remove a file and its chunks from the database public bool|array MongoGridFS::delete ( mixed $id ) Note: MongoGridFS::delete() is a convenience method for calling MongoGridFS::remove() with specific criteria and default options parameters. Parameters: id _id of the file to remove. Returns: Returns an array containing t