Closed meabed closed 7 months ago
Hi @nodkz this PR is ready now ✅ - would you please have a look - we might as well increase the version to major to address the dropping support of nodejs 14 and mongoose 5.
Even node16 is EOL, and Mongoose 6 is EOL too
Attention: 11 lines
in your changes are missing coverage. Please review.
Comparison is base (
91cdfd0
) 92.54% compared to head (acc33b2
) 91.67%. Report is 5 commits behind head on master.:exclamation: Current head acc33b2 differs from pull request most recent head bc859d9. Consider uploading reports for the commit bc859d9 to get more accurate results
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Amazing works @meabed hopefully we will have this enhancement release soon.
@nodkz do you think anything pending for this to be released?
@meabed could you please review my last commit https://github.com/graphql-compose/graphql-compose-mongoose/pull/439/commits/2b80ad2bf9b541266428d751d126ddc225f9f628 ?
I dislike the idea of using some patches in runtime for instances of 3rd code/packages. So I revised all logic and found the root of our problem - incorrect use of fieldname in compound index of User mock:
const UserSchema = new Schema(
n: {
type: String,
required: true,
description: 'Person name',
alias: 'name',
},
);
- UserSchema.index({ name: 1, age: -1 });
+ UserSchema.index({ n: 1, age: -1 });
So it's error-prone to use aliases (name
) inside compound indexes. Must be used the real field name (n
) like it is in database.
I made appropriate changes in src/utils/getIndexesFromModel.ts
and now it works with Mongoose 6, 7, 8.
Sounds good 😌 also my pr in mongoose is merged
@meabed thank you a lot for the gorgeous PR 💪
Thank you @nodkz I have upgraded and tested 🚀 all looks great :)
Also the PR for index order in mongoose has been released: https://github.com/Automattic/mongoose/releases/tag/8.0.1
Hey @nodkz, Hope all is well, this PR to support mongoose 8 as it was release few days ago
Summary of the changes:
PR Testing are here: https://github.com/meabed/graphql-compose-mongoose/pull/3
Pending Mongoose fix release: mongoose changed slightly the order of the index attributes when it has an alias - so the order for sorting enum is failing in the test.
I have a workaround already implemented to patch the index method
and the PR landed in mongoose we can remove it : I have a PR in mongoose to fix it https://github.com/Automattic/mongoose/pull/14042