The MongoBinData class
Introduction
An object that can be used to store or retrieve binary data from the database.
The maximum size of a single object that can be inserted into the database is 4Mb. For data that is larger than this (movies, music, Henry Kissinger's autobiography), use MongoGridFS. For data that is smaller than 4Mb, it will probably be easier to just embed it into the document using MongoBinData.
<?php
$profile = array("username" => "foobity",
"pic" => new MongoBinData(get_file_contents("gravatar.jpg"));
$users->save($profile);
?>
Class synopsis
MongoBinData
MongoBinData
{
/* Fields */
public
string
$bin
;
public
int
$type
= 2
;
/* Methods */
}Table of Contents
- MongoBinData::__construct — Creates a new binary data object.
- MongoBinData::__toString — The string representation of this binary data object.
MongoBinData
There are no user contributed notes for this page.
