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

Support for HABTM #233

Open
Startouf opened this issue Jul 13, 2020 · 0 comments
Open

Support for HABTM #233

Startouf opened this issue Jul 13, 2020 · 0 comments

Comments

@Startouf
Copy link

Is it possible to add habtm (has and belongs to many) support ? Or maybe this is already supported in a different way ?

The use case is to avoid intermediate tables when it's not necessary, so we'd be able to write something like that

interface TagType {
  name: string;
}

const tagSchema = new Schema<TagType>({
  name: { type: String },
})

interface UserType {
  tags: entity.Key[]
}

const userSchema = new Schema<EventType>({
  teachers: { type: Schema.Types.Keys, ref: 'Tag' },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants