我正在使用保梅尔尼科夫的ObjCMongoDB连接到我的iOS中的mongodb。我想使用MongoCursor分块加载数据。我需要帮助来实现这一点。
谢谢。
发布于 2014-12-12 11:58:51
您可以只调用-[MongoDBCollection cursorForFindAllWithError:],或其他返回游标的方法之一,然后对其进行迭代。
NSError *error = nil;
MongoCursor *cursor = [collection cursorForFindAllWithError:&error];
if (cursor) {
for (BSONDocument *document in cursor) {
// do something with document
}
} else {
NSLog(@"Error: %@", [error localizedDescription]);
}https://stackoverflow.com/questions/26650291
复制相似问题