Skip to content
This repository has been archived by the owner on Jun 29, 2021. It is now read-only.

[Suggestion] Allow refs to be something other than ObjectID types #146

Closed
mattjennings opened this issue May 10, 2018 · 2 comments
Closed

Comments

@mattjennings
Copy link

typegoose/src/prop.ts

Lines 86 to 93 in 2ffe774

if (ref) {
schema[name][key] = {
...schema[name][key],
type: mongoose.Schema.Types.ObjectId,
ref: ref.name,
};
return;
}

Ran into a CastError when referencing schemas that use _id as a number instead of ObjectID. Other valid types are Number, String, and Buffer

I might be able to take a stab at it this weekend.

@mattjennings
Copy link
Author

Created a pull request #148

@hasezoey hasezoey mentioned this issue Jul 31, 2019
14 tasks
@hasezoey
Copy link
Contributor

@Ben305 this can be closed because all the PR's for this got closed / merged (into v6.0.0)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants