ObjCMongoDB db.collection.find() [英] ObjCMongoDB db.collection.find()

查看:33
本文介绍了ObjCMongoDB db.collection.find()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 iOS 应用程序中对 mongoDB 实现复杂的查询.我正在使用 ObjCMongoDB,它运行良好.我可以在数据库上实现计数查询,请看下面的代码

I want to implement complex queries on mongoDB in my iOS app. I’m using ObjCMongoDB and it’s working perfectly. I’m able to implement the count query on the database, please see the following code

commandDict = @{@"count": @"logs",@"query":@{@"detector":@"kaspersky"}};
commandDictdata = [dbConn runCommandWithDictionary:commandDict onDatabaseName:@"logdb" error:&error];

我正在尝试实现 db.collection.find() 但遇到了麻烦.任何人都可以解释我如何做到这一点.

I’m trying to implement db.collection.find() but having troubles. Can anyone explain me how to do this.

谢谢.

推荐答案

-runCommandWithDictionary 不能用于执行等效于 db.collection.find().

-runCommandWithDictionary can't be used to perform the equivalent of db.collection.find().

你必须使用 MongoKeyedPredicate.目前图书馆没有办法将字典传递给 mongo_find.

You have to use MongoKeyedPredicate. At present the library doesn't have a way to pass a dictionary to mongo_find.

我是图书馆的作者.欢迎提出拉取请求.

I'm the author of the library. A pull request would be welcome.

这篇关于ObjCMongoDB db.collection.find()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆