Skip to content

Query.findAll() doesn't use exclude/excludeKeys #1990

Closed
@sadortun

Description

@sadortun

New Issue Checklist

Issue Description

Hi!!

When using findAll() to execute a query, the exclude parameter is omited.

You can see here that include and select are copied from the local this to query, but exclude is omited

query._include = this._include.map(i => {
return i;
});

Not sure if it's the expected behaviour, if so, it should be documented.

Patch here : sadortun@2ee3d53

Steps to reproduce

const q1  = Parse.Query('Player')
q1.include('team')
q1.exclude('team.logo')

q1.limit(999999)
const players = q1.find() //  Fast, logo is excluded


const q2  = Parse.Query('Player')
q2.include('team')
q2.exclude('team.logo')

const players = q1.findAll()  //  Slow, logo is present

side note: q1.toJSON() and q2.toJSON() produce expected output

Actual Outcome

  • q1 : Contains Teams, without logos
  • q2: Contains teams WITH logos

Expected Outcome

  • q1 : Contains Teams, without logos
  • q2: Contains teams without logos

Environment

Server

  • Parse Server version: 6.2.1
  • Operating system: windows 🤡
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): local

Database

  • System (MongoDB or Postgres): mongo
  • Database version: recent
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): local

Client

  • Parse JS SDK version: 4.0.1

Logs

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