我使用以下语法来获取具有特定凝视的所有字段和字段值
<?php
$db = new MongoClient();
$db->mydatabase->pdf->ensureIndex(array(
"subject" => 'text'
));
$result = $db->mydatabase->command(array(
"text" => "pdf",
"search" => "java"
));
if ($result) {
foreach ($result as $doc) {
echo $doc['Author'];
echo 'Author:' . $doc['Author'] . '<br/>';
echo 'title:' . $doc['title'] . '<br/>';
echo 'url:' . '<a href="http://10.0.0.26/cis/ebookOReillyJavaCookbook.PDF">' . $doc['url'] . '</a>' . '<br/>';
}
}
?>
但这给了我以下输出
Author:
title:
url:
请帮助我,我已经阅读了这方面的文档,但我无法获得解决方案
谢谢