Automattic / Automattic/mongoose

Use prefixed internal properties to allow more freedom for schema path names

Open
#4,688 4 comments 0 reactions 0 assignees View on GitHub
backwards-breaking discussion
Dominant language
JavaScript
Stars
27.5k
Forks
4k
Avg merge
2d 7h
Merged PRs (30d)
35

Description

This is likely going to be something for a next major release, but I'd like to see the limitations that are currently in place for restricted schema path names lifted, by using internal properties which are prefixed with `_` or `$` or anything else, so that users are free to use any non-prefixed path name they like.

I've run into this limitation twice now, where I wanted to have `isNew` and `collection` as my document properties. (It's surprisingly hard to find a synonym for `isNew` that is as concise and to the point.)

So I'm throwing it up here for discussion, what do you think?

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by tracing where Mongoose restricts schema path names and how internal properties are represented; the issue is done only after the project has agreed on and tested a design that permits the requested non-prefixed names.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, mongodb, nodejs
Domain
backend, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.