Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
sadortun opened this issue Aug 10, 2023 · 2 comments · Fixed by #2000
Closed
4 tasks done

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

sadortun opened this issue Aug 10, 2023 · 2 comments · Fixed by #2000
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@sadortun
Copy link
Contributor

sadortun commented Aug 10, 2023

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

@parse-github-assistant
Copy link

parse-github-assistant bot commented Aug 10, 2023

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

sadortun added a commit to sadortun/Parse-SDK-JS that referenced this issue Aug 10, 2023
@sadortun sadortun changed the title Query.findAll() doesn't use exclude/excludeKeys Query.findAll() doesn't use exclude/excludeKeys` Aug 11, 2023
@sadortun sadortun changed the title Query.findAll() doesn't use exclude/excludeKeys` Query.findAll() doesn't use exclude/excludeKeys Aug 11, 2023
@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Aug 16, 2023
@mtrezza
Copy link
Member

mtrezza commented Aug 16, 2023

Looks like a bug to me, would you want to open a PR with a test?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants