Mongo Funkcje
PHP Manual

mongo_gridfs_list

(PECL mongo >= 0.8.0)

mongo_gridfs_listQuery for files in the grid collection

Opis

resource mongo_gridfs_list ( resource $gridfs , array $query )

Query for files in the grid collection.

Parametry

gridfs

The gridfs connection to use.

query

The file qualities for which to query.

Zwracane wartości

Returns a cursor to information about the matching gridfs files.

Przykłady

Przykład #1 mongo_gridfs_list() example

This example shows how to list the files in a grid collection.

<?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
$cursor mongo_gridfs_list($gridfs, array("filename" => "profilePic.jpg"));

while (
mongo_has_next($cursor)) {
    
$f mongo_next($cursor);
    echo 
$f["filename"] . "\n";
}

?>

Powyższy przykład wyświetli coś podobnego do:

file1.txt
file2.txt
mypic.jpg

depending on what is in the database.

Zobacz też:


Mongo Funkcje
PHP Manual