gpt4 book ai didi

swift - 解析为 Kinvey 查询

转载 作者:行者123 更新时间:2023-11-28 08:44:10 25 4
gpt4 key购买 nike

由于关闭,我刚刚从解析迁移到 kinvey,我想知道是否有人可以帮助我弄清楚这个查询在 kinvey SDK 中的样子。在这里:

let innerP1 = NSPredicate(format: "sender = %@ AND other = %@", userName, otherName)
let innerQ1:PFQuery = PFQuery(className: "Messages", predicate: innerP1)

let innerP2 = NSPredicate(format: "sender = %@ AND other = %@", otherName, userName)
let innerQ2:PFQuery = PFQuery(className: "Messages", predicate: innerP2)

let query = PFQuery.orQueryWithSubqueries([innerQ1,innerQ2])
query.addAscendingOrder("createdAt")
query.findObjectsInBackgroundWithBlock {
(objects:[PFObject]?, error:NSError?) -> Void in //UPDATE THIS
}

最佳答案

作为一个广泛的例子......

http://devcenter.kinvey.com/phonegap/reference/api/Kinvey.Query.html

var query = new Kinvey.Query();
var query2 = new Kinvey.Query();
query.equalTo("sender",userName).and().equalTo("other",other name);
query2.equalTo("sender",otherName).and().equalTo("other",userName);
query.or(query2);
query.ascending("_kml.lmt"); //last modified time

var promise = Kinvey. DataStore.Find("group name",query);
promise.then(successfunction,fail function);

另请注意,这是 phonegap 库的示例,请根据您的情况查看适用于 Android 或 iOS 的 kinvey 引用。

关于swift - 解析为 Kinvey 查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35737435/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com