Run on mongoose 6 (replaces #70) #71
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
backmeupplz/banofbot!71
Loading…
Reference in a new issue
No description provided.
Delete branch "mongoose-6"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Dependabot's #70 (mongoose 5.7.0 → 6.13.10) plus the code change it needs. mongoose 6 throws
"useCreateIndex" is not a valid option to setat startup, so #70 on its own would crash the bot on deploy.mongoose.set('useCreateIndex' / 'useFindAndModify')and the no-opuseNewUrlParser/useUnifiedTopologyconnect flagsmongoose.set('strictQuery', false)keeps v5's query filtering (v6 would silently drop unknown filter fields)Testing
I tested against the prod server version, MongoDB 3.6.23 (
banofbot-db), on Node 22. The realapp.jsran with a fake Telegram bot through this script: group created,/help,/language+ language callbacks,/limit+lti,/time+tlti,/votekickWord, a keyword ban request, four votes (one repeat), the kick, an admin candidate,/lockand a locked non-admin command.Deploy note
v5 stopped building indexes at the first error: the declared unique
{id: 1}conflicts with the existing non-uniqueid_1. v6 carries on, so the first start builds three indexes the schemas already declare but prod never got: chats{type: 1, last_ban: -1}, chats{newcomers.0: 1}and users{first_name: 1, last_name: 1}. They're built withbackground: true, so on 3.6 they don't lock the collections.🤖 Generated with Claude Code