Skip to content

.select() in finds and firsts does not seem to exclude any fields #86

Closed
@pmmlo

Description

@pmmlo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions