Closed
Description
Hey @cbaker6 - Do you think this could be an encoding problem or a potential parse-server bug?
struct GameScore: ParseObject {
var objectId: String?
var createdAt: Date?
var updatedAt: Date?
var ACL: ParseACL?
var score: Int?
}
var score = GameScore()
score.score = 200
try score.save()
let afterDate = Date().addingTimeInterval(-300)
var query = GameScore.query("createdAt" > afterDate).select(["score"]).limit(1)
query.find() { results in
print(results) /// <<< I would expect only the GameScore objects with createdAt after afterDate to only return the "score" field. (Yes, this is lazy.)
}
/// Alternatively
query.first() { results in
print(results)
}
Anybody have any thoughts? Will dig deeper into the source, if not. Thanks!
EDIT:
.select() does seem to work, as of late. Reference: https://stackoverflow.com/questions/61100282/parse-server-select-a-few-fields-from-included-object