Automattic / Automattic/mongoose
Option to not create the collection when compiling model
- Dominant language
- JavaScript
- Stars
- 27.5k
- Forks
- 4k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 35
Description
### Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the feature has not already been requested
### 🚀 Feature Proposal
Placing `null` in the collectionName argument should make it not create a collection for that model
### Motivation
_No response_
### Example
`mongoose.model(name, schema, null)`
Contributor guide
Research direction
Start by tracing how mongoose.model(name, schema, null) handles the collectionName argument and where model compilation triggers collection creation. Confirm the expected behavior against the existing model and collection lifecycle tests; done means a null collection name compiles the model without creating a collection.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb
- Domain
- backend, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100