Home >Backend Development >PHP Tutorial >MongoDB 2d空间索引怎么分页显示?

MongoDB 2d空间索引怎么分页显示?

WBOY
WBOYOriginal
2016-06-06 20:50:011366browse

代码:

<code class="lang-php">$row = $mongodb->users->command(array(
        'geoNear'=>'location',
        'near'=> array(39.937882,116.46289),
        'limit' => 4,
    ));
print_r($row);
</code>

加入skip,无效。command方法后追加->skip(N),无效……num和limit作用一样的。

就没办法分页么?

回复内容:

代码:

<code class="lang-php">$row = $mongodb->users->command(array(
        'geoNear'=>'location',
        'near'=> array(39.937882,116.46289),
        'limit' => 4,
    ));
print_r($row);
</code>

加入skip,无效。command方法后追加->skip(N),无效……num和limit作用一样的。

就没办法分页么?

现在MongoDB还不支持。参见tickets SERVER-3925 和 SERVER-5800。 你可以在JIRA上跟踪这个feature, 也可以给它们投票。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn