Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ref type docs missing #13400

Closed
1 task done
sanjarcode opened this issue May 14, 2023 · 2 comments · Fixed by #13474
Closed
1 task done

Ref type docs missing #13400

sanjarcode opened this issue May 14, 2023 · 2 comments · Fixed by #13474
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone

Comments

@sanjarcode
Copy link

Prerequisites

  • I have written a descriptive issue title

Mongoose version

7.1.1

Node.js version

16.17.0

MongoDB version

6.0.5

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

20.04

Issue

What are the implications of types if set on a ref, is missing?
Location:

user and have a good reason for doing so.

@sanjarcode sanjarcode added help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary help wanted labels May 14, 2023
@nitin1chandani
Copy link

I want to resolve this issue, but I am not getting what docs are missing @sanjarcode can you please explain this as I am a begineer?

@vkarpov15
Copy link
Collaborator

@sanjarcode we'll adjust the docs, this warning is a bit overzealous. There aren't significant implications of adding ref to a particular property. We just advise using ObjectIds for refs for consistency because MongoDB generates ObjectIds for _id by default, so if you prefer numbers or UUID buffers you need to be careful that you're consistently generating numbers or UUIDs for ids. This was more important in older versions of Mongoose before setDefaultsOnInsert was enabled by default.

@vkarpov15 vkarpov15 added this to the 7.1.3 milestone May 16, 2023
@vkarpov15 vkarpov15 added docs This issue is due to a mistake or omission in the mongoosejs.com documentation and removed help This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary help wanted labels May 16, 2023
@vkarpov15 vkarpov15 modified the milestones: 7.2.2, 7.2.3 May 30, 2023
vkarpov15 added a commit that referenced this issue Jun 7, 2023
docs(populate): add a little more info on why we recommend using ObjectId for `_id`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
3 participants