Conversation
Preserve the monolithic userdb schema as a legacy fallback. This file will be the only reference to the old "userdb" collection and is designed to be deleted when sunsetting is complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New core user schema targeting the "users" collection (replacing the monolithic "userdb"). Currencies live under currency.*, profile under profile.*, and progression under progression.* per mongoscript spec. Includes statics (get/set/getFull/new) matching the existing API. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extracts inventory and collectible data from the monolithic userdb into a dedicated user_cosmetics collection. Includes ported addItem, removeItem, modifyItems, hasItem, amtItem instance methods plus get/set/getFull/new statics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ics, connections Five new collection schemas completing the user data split: - user_oauth: Discord/Patreon tokens and identity cache - user_guilds: cached guild memberships (userId+guildId compound key) - user_quests: per-quest progress tracking (userId+questId compound key) - user_analytics: statistics and legacy metrics - user_connections: third-party linked accounts (userId+type compound key) All include appropriate indexes matching the mongoscript migration spec. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
DB.users now points to the new UsersCore model (collection "users"). New exports: userCosmetics, userOAuth, userGuilds, userQuests, userAnalytics, userConnections. Legacy monolithic model available as DB._legacyUserDB (deprecated) and DB.userDB (deprecated alias). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Virtual population paths now reference the "UsersCore" model name (new "users" collection) instead of "UserDB" (legacy "userdb"). Also updates marriageData localField to profile.featuredMarriage. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds interfaces for UserCore, UserCurrencies, UserProfile, UserProgression, UserMeta, PrimeData, and all satellite document types (UserCosmeticsData, UserOAuthData, UserGuildData, UserQuestData, UserAnalyticsData, UserConnectionData) plus their Model interfaces. Updates the Schemas interface to expose the new collections and marks legacy User/UserModules/userDB types as deprecated. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Minor version bump signals the availability of the new split user collections (users, user_cosmetics, user_oauth, user_guilds, user_quests, user_analytics, user_connections) alongside the legacy monolithic userdb. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…virtuals
- items.js: model("UserDB") → model("UsersCore"), modules.inventory → profile.inventory
- achievements.js: require users.js → user_cosmetics.js, modules.achievements → achievements
- virtuals.js: localField modules.inventory.id → profile.inventory.id
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
inventory lives in user_cosmetics collection, not in users.profile. Moved the virtual from Users (UsersCore) to UserCosmetics with localField: "inventory.id" matching the actual collection structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Rename collection, schema, model, and all TypeScript definitions from UserCosmetics/userCosmetics to UserInventory/userInventory to better reflect the collection's purpose. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…UnifiedTopology, useCreateIndex)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a major refactor of user-related database schemas, splitting the legacy monolithic
userdbcollection into multiple focused collections. It also adds a Mongoose plugin to make.lean()the default forfind/findOnequeries, improving performance and memory usage. The changes are backward-compatible for now, with the legacy schema retained for migration purposes.User schema refactor and new collections:
userdbschema into new, specialized collections:users_core,user_inventory,user_oauth,user_guilds,user_quests,user_analytics, anduser_connections, each with its own schema and file. The main schema export (schemas.js) now exposes these new collections as the authoritative source for user data. (schemas.js,schemas/user_analytics.js,schemas/user_connections.js, [1] [2] [3]_legacy_users.jsand is only used for fallback/shim purposes, with clear deprecation warnings. (schemas/_legacy_users.js, schemas/_legacy_users.jsR1-R375)userDBexport inschemas.jsnow points to the legacy schema, whileusersand the new per-feature collections point to the split schemas. (schemas.js, schemas.jsL48-R73)Query conventions and performance improvements:
leanDefaultPlugin.js) that makes.lean()the default for allfindandfindOnequeries, unless explicitly opted out with{ lean: false }. This reduces memory usage and improves query speed. (index.js,leanDefaultPlugin.js, [1] [2]Code updates for new schema structure:
user_inventory.jsfor achievements, andUsersCorefor item operations, instead of the olduserdb. (schemas/achievements.js,schemas/items.js, [1] [2]Other:
0.19.0to reflect these breaking and structural changes. (package.json, package.jsonL3-R3)