Automattic / Automattic/mongoose

Is it possible to have multi-key discriminators?

Open
#9,756 2 comments 4 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
27.5k
Forks
4k
Avg merge
2d 7h
Merged PRs (30d)
35

Description

**Do you want to request a *feature* or report a *bug*?**

Feature

**What is the current behavior?**

Currently, we can only have one key as the discriminator key, but as discussed in #5846 (I think it was closed by accident) it seems like a nice feature

**What is the expected behavior?**

The possibility to use multiple keys as discriminators to track "sub-versions" of a discriminator. It's kind of related to #2851 since it would allow the use of multiples discriminators on the same document

Are there any plans for implementing this in the future?

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Start by reviewing the existing discriminator implementation and the discussion in #5846 and #2851. Done would mean Mongoose supports multiple discriminator keys for tracking sub-versions and multiple discriminators on the same document.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, nodejs
Domain
backend, database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.