Skip to content

Count does not work with masterKey on postgres #8286

Open
@dblythy

Description

@dblythy

New Issue Checklist

Issue Description

Using query.count({useMasterKey: true}) returns 0 objects.

Steps to reproduce

it('count objects', async () => {
    const obj = new Parse.Object('TestObject');
    const obj2 = new Parse.Object('TestObject');
    await Parse.Object.saveAll([obj, obj2]);
    const query = new Parse.Query('TestObject');
    const count = await query.count({ useMasterKey: true });
    equal(count, 2); // this fails, count is 0.
  });

Actual Outcome

Count is 0

Expected Outcome

Count should return.

Environment

Server

  • Parse Server version: 5.3.0
  • Operating system: macos
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): localhsot

Database

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

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): js
  • SDK version: -

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bounty:$20Bounty applies for fixing this issue (Parse Bounty Program)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