是否可以将mongo游标迭代两次? [英] Is it possible to iterate a mongo cursor twice?
本文介绍了是否可以将mongo游标迭代两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
换句话说,是否有办法将其倒带到开头?
In other words, is there a way to rewind it to the beginning?
编辑
我正在使用mongo shell和pymongo.
I am using mongo shell and pymongo.
推荐答案
Ruby API 具有rewind!
方法,可以完全满足您的要求.
The Ruby API has the rewind!
method that does exactly what you want.
Python API 也具有cursor.rewind()
方法.
PHP API 也具有cursor.rewind()
方法.
但是,Java或C ++ API都没有rewind方法.所有内容都可以在官方API页面中找到.
However, neither the Java or C++ APIs have the rewind method. All can be found from the official API page.
这篇关于是否可以将mongo游标迭代两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文