Новости | Документация | Download | Webboard | FAQ | Поиск | Контакты


mongo_gridfs_init

(PECL mongo >= 0.8.0)

mongo_gridfs_init — Creates a new gridfs connection

Описание

resource mongo_gridfs_init ( resource $connection , string $db , string $prefix )

Creates a new gridfs connection which can be used to interact with files in the database.

Список параметров

connection

The database connection to use.

db

The name of the database to use.

prefix

The prefix for the grid collections (usually "fs").

Возвращаемые значения

A connection to the grid filesystem.

Примеры

Пример #1 mongo_gridfs_init() example

This example creates a new connection and uses it to find a file in the database.

<?php

$conn 
= mongo_connect("localhost", true);
if (!
$conn) {
   die(
"Could not connect.");
}
// create a new grid connection
$gridfs = mongo_gridfs_init($conn, "blog", "fs");

// query for the filename
$file = mongo_gridfs_find($gridfs, array("filename" => "profilePic.jpg"));

?>

$jpg will now be storing a file resource.

Смотрите также






  Copyright Apache.ru © 1999-2017, All Rights Reserved Разработка сайта: Inside.ru  
  РЕКЛАМА НА САЙТЕ: |