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

Update Mongo driver to v6.9.0 #4680

Merged
merged 24 commits into from
Oct 8, 2024
Merged

Update Mongo driver to v6.9.0 #4680

merged 24 commits into from
Oct 8, 2024

Conversation

nick-funk
Copy link
Contributor

@nick-funk nick-funk commented Oct 7, 2024

What does this PR do?

  • Upgrades Mongo to the latest driver (v6.9.0)

These changes will impact:

  • commenters
  • moderators
  • admins
  • developers

What changes to the GraphQL/Database Schema does this PR introduce?

None

Does this PR introduce any new environment variables or feature flags?

No

If any indexes were added, were they added to INDEXES.md?

N/A

How do I test this PR?

This touches all of Coral's data retrieval and persistence, all features must be re-tested in a regression test.

Were any tests migrated to React Testing Library?

No

How do we deploy this PR?

  • Deploy to staging/testing environments
  • Perform a full regression test
    • Fix any critical bugs that are found
  • Issue out a release

@nick-funk nick-funk requested review from tessalt and kabeaty October 7, 2024 16:09
Copy link

netlify bot commented Oct 7, 2024

Deploy Preview for gallant-galileo-14878c canceled.

Name Link
🔨 Latest commit be604fd
🔍 Latest deploy log https://app.netlify.com/sites/gallant-galileo-14878c/deploys/6705595ca5187b0008784590

Copy link
Contributor

@kabeaty kabeaty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything seems to be working great with the update! I left a few questions throughout.

@@ -116,10 +118,12 @@ export async function retrieveTodayCommentMetrics(
continue;
}

const mod = moderator;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious why we're assigning this here now? Looks like we're still using moderator on line 124 though? (Same question about similar change below in the file too)

Copy link
Contributor Author

@nick-funk nick-funk Oct 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a bug in typescript, it sometimes fails to process types after a continue op. If you re-assign, it works. So I did that for the few lines that were "erroring" (but compile and run fine).

@@ -65,15 +70,16 @@ export default class Query<T> {
* orderBy will apply sorting to the query filter when executed.
* @param sort the sorting option for the documents
*/
public orderBy(sort: object): Query<T> {
public orderBy(sort: { [key: string]: SortDirection }): Query<T> {
// todo: merge sort's together
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this still a TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope! I "sorted" this earlier! I will update!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed!

// believe we don't need this since the new driver only uses
// the new URL parser. But am leaving this here in case we have
// issues with URL's and want to investigate into it.
// useNewUrlParser: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -1,5 +1,5 @@
import { identity, isNumber } from "lodash";
import { MongoError } from "mongodb";
import { Collection, MongoError } from "mongodb";
import { v4 as uuid } from "uuid";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing a warning in the console: "(node:85676) [MONGODB DRIVER] Warning: cursor.count is deprecated and will be removed in the next major version, please use collection.estimatedDocumentCount or collection.countDocuments instead".

Looks like we are using deprecated count() on line 135 in this file. Should we update to one of the suggested replacements now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking into this, will see if I can update the query

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup, was an easy fix, done!

@tessalt tessalt merged commit ee5e64a into develop Oct 8, 2024
6 checks passed
@tessalt tessalt deleted the feat/update-mongo branch October 8, 2024 17:10
@rigperro
Copy link
Contributor

Very nice! What mongo version are you looking to use with this?

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 this pull request may close these issues.

4 participants