我正在尝试查看基于所选月份和年份的查询:
我已经选择了声明的日期( //dateselectedStr = "2016-11“)
并且在线数据库中的存储日期包含相同的2016-11年的updatedAt,如何基于有.contain的查询进行检索?这是我的足迹
query.order(byDescending: "updatedAt")
if PFUser.current() != nil {
query.whereKey(CARD_UPDATED_AT, contains: dateselectedStr)
query.findObjectsInBackground { (objects, error)-> Void in
if error == nil {
self.recipesArray = objects!
// Reload CollView
self.recipesCollView.reloadData()
let counter = (objects!.count)
print(counter)
self.title = "\(counter) JOB CARDS"
self.hideHUD()
// Hide/show the nothing found Label
if self.recipesArray.count == 0 { self.nothingFoundLabel.isHidden = false
} else { self.nothingFoundLabel.isHidden = true }
} else {
self.simpleAlert("\(error!.localizedDescription)")
self.hideHUD()
}}发布于 2016-11-30 21:02:33
AFAIK,这是唯一可能的解决方案
2016年,
updatedAt >= 01-01-2016 & updatedAt <= 31-12-2016
一月份,
updateAt >= 01-01-2016 & updatedAt <= 31-01-2016
希望这能有所帮助:)
https://stackoverflow.com/questions/40883067
复制相似问题