Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface Profile {
- username: string,
- articles: [Article]
- }
- interface Article {
- index: number,
- name: string,
- }
- // Mongoose model
- export interface IProfile extends Profile, Document { }
- const Article = new Schema({
- index: { type: Number, required: true },
- name: { type: String, required: true },
- }, { _id: false })
- const Profile = new Schema({
- username: { type: String, index: true },
- upcomingChests: { type: [Article] },
- }, { timestamps: true })
- export const Profile = model<IProfileModel>('IProfile', Profile)
- const profile: Profile = values[0]
- const articles: Array<Article> = values[1]
- profile.articles = articles // Error/Warning pops up in this line
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement