Skip to content
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

[Bug] buildSchema is executed before mongoose set strictQuery to false in initSync function #939

Closed
EasonSoong opened this issue Aug 15, 2022 · 1 comment

Comments

@EasonSoong
Copy link
Contributor

Bug Report

https://github.com/payloadcms/payload/blob/master/src/mongoose/connect.ts#L42
This line is executed before buildSchema in initAsync function. But after buildSchema in initSync function. And this makes the query api behavior different.

Expected Behavior

Setting strictQuery to false should be executed before buildSchema in initSync function too.

Current Behavior

Setting strictQuery to false is executed after buildSchema in initSync.

Possible Solution

Rearrange the execute order in initSync.

Steps to Reproduce

  1. Try initAsync and initSync function.

Detailed Description

1.0.22

@EasonSoong EasonSoong added the bug label Aug 15, 2022
@payloadcms payloadcms deleted a comment from Dropnspl87 Aug 15, 2022
@jmikrut
Copy link
Member

jmikrut commented Aug 15, 2022

Related discussion: #852

jmikrut added a commit that referenced this issue Aug 16, 2022
@jmikrut jmikrut mentioned this issue Aug 16, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants