Skip to content

Using Query.select() will break ParseObject.has() on undefined field from 2.5.1 #3999

Closed
@promisenxu

Description

@promisenxu

Issue Description

Starting from Parse Server 2.5.1, if a query has Query.select() , calling .has() on the returned object with a selected field that's undefined will return true.

Steps to reproduce

var query = new Parse.Query('ClassName');
query.include('FieldName');
query.select('FieldName');
query.get('objectId', {useMasterKey: true}).then(result => {
// Assume FieldName is undefined for the returned object
result.has('FiledName'); // This will return true.
});

Expected Results

.has() on a field with undefined value should return false, which is the behaviour up to 2.5.0.

Actual Outcome

Return true.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.5.1, 2.5.2, 2.5.3
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Heroku
  • Database

    • MongoDB version: 3.0.11 (MMAPv1)
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions