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

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

WBOY
Release: 2016-06-06 20:50:01
Original
1370 people have browsed it

代码:

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

加入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>
Copy after login
Copy after login

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

就没办法分页么?

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template