Skip to content

chore(idurar-erp-crm/backend): upgrade mongoose to latest 8.x (8.24.0)#711

Draft
augmentcode[bot] wants to merge 1 commit into
mainfrom
hammads-turing/upgrade-mongoose-8x
Draft

chore(idurar-erp-crm/backend): upgrade mongoose to latest 8.x (8.24.0)#711
augmentcode[bot] wants to merge 1 commit into
mainfrom
hammads-turing/upgrade-mongoose-8x

Conversation

@augmentcode
Copy link
Copy Markdown

@augmentcode augmentcode Bot commented May 26, 2026

Summary

Upgrades Mongoose to the latest 8.x in idurar-erp-crm/backend:

  • mongoose: ^8.1.1^8.24.0 (resolved 8.24.0)
  • Adds explicit mongoose.set('strictQuery', false) immediately before every mongoose.connect(...) call.

Why

The project pinned a 17-month-old 8.1.1 range. Picking up the rest of the 8.x line brings bug fixes and MongoDB driver updates without crossing a major. Within 8.x there are no breaking changes that affect this codebase — the relevant ones (Query#and()/or()/nor() argument validation, Model.findOneAndUpdate defaults, etc.) only fire on invalid input the code does not produce.

strictQuery / connection options

  • strictQuery. Mongoose 7 changed the default from true to false and dropped the noisy 6.x deprecation warning. The project never set it explicitly, so it's been silently riding the default. To make the intent visible and immune to whatever Mongoose 9 chooses, every connect site now sets false explicitly:
    • src/server.js
    • src/setup/setup.js
    • src/setup/reset.js
  • Legacy connect options. useNewUrlParser, useUnifiedTopology, useCreateIndex, useFindAndModify were removed back in Mongoose 6. None of them appear in the codebase — mongoose.connect(process.env.DATABASE) is already the modern minimal form, so no further connect-option changes are needed.

Verification

  • npm install mongoose@^8.24.0 succeeds; lockfile updated.
  • node -e "require('mongoose')" reports 8.24.0.
  • Booting the server with a dummy DATABASE URI exits cleanly with Express running → On PORT : 8888 and no strictQuery deprecation warning.

Notes

  • The session that opened this PR is a manual session but only the org-bot github-app-api tool was available, so the PR shows as bot-created. Cosmos misconfiguration to fix on the operator side; no impact on the change itself.
  • npm install surfaced pre-existing warnings on unrelated packages (multer@1.4.4, shortid, html-pdf, etc.). Out of scope for this PR.

Pull Request opened by Augment Code | View session

Bumps mongoose from ^8.1.1 to ^8.24.0 in idurar-erp-crm/backend.

Adds an explicit mongoose.set('strictQuery', false) in the three entry points (server.js, setup/setup.js, setup/reset.js) to lock in the Mongoose 7+ default and avoid drift when newer majors flip behavior again.

No legacy connection options (useNewUrlParser, useUnifiedTopology, useCreateIndex, useFindAndModify) were present, so the connect() call is unchanged.
@augmentcode
Copy link
Copy Markdown
Author

augmentcode Bot commented May 26, 2026

PR Author Agent

👋 I've got this PR — here's what I'll handle for you:

  • Review feedback — implement suggestions, answer questions, fix what comes up
  • CI failures — I get pinged when checks fail and try to fix them
  • Merge conflicts — bring the PR back up to date when it falls behind
  • Merge gates — watch CI, reviews, and verification
  • Ping you the moment it's ready to merge

Marking it ready and picking reviewers are your call — I'll leave both alone.

Drop a comment anytime!

@augmentcode
Copy link
Copy Markdown
Author

augmentcode Bot commented May 27, 2026

Deep Code Review Agent🐛

Started — view session to follow along.

Copy link
Copy Markdown
Author

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Review completed with 0 suggestions.

@augmentcode
Copy link
Copy Markdown
Author

augmentcode Bot commented May 27, 2026

PR Author Agent

All blocking gates are green on ebdaef03 — ready to flip to ready-for-review whenever you are. Reply mark ready here, or use the Ready for review button on GitHub.

Copy link
Copy Markdown
Author

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

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

Deep Code Review Agent🐛

Review completed with 0 suggestions.

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.

1 participant