Skip to content

Commit

Permalink
fix: fix highlight and duplicate example
Browse files Browse the repository at this point in the history
the example contained mongoose example within it and had wrong lines highlighted
  • Loading branch information
khawarizmus authored and doug-martin committed Jul 10, 2021
1 parent 8649b0c commit 50b09a0
Showing 1 changed file with 1 addition and 37 deletions.
38 changes: 1 addition & 37 deletions documentation/docs/persistence/typegoose/relations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export class TodoItemEntity extends Base {
<TabItem value="tag">


```ts title="tag/tag.entity.ts" {23-27}
```ts title="tag/tag.entity.ts" {15-21}
import { Prop, modelOptions, Ref } from '@typegoose/typegoose';
import { Base } from '@typegoose/typegoose/lib/defaultClasses';

Expand Down Expand Up @@ -293,42 +293,6 @@ export class TagEntity extends Base {
@Prop()
updatedBy?: string;
}


import { Base } from '@typegoose/typegoose/lib/defaultClasses';
import { Prop, modelOptions, Ref} from '@typegoose/typegoose';
import { TodoItemEntity } from '../todo-item/todo-item.entity';

@modelOptions({
schemaOptions: {
timestamps: true,
collection: 'tags',
toObject: { virtuals: true }
}
})
export class TagEntity extends Base {

@Prop({ required: true })
name!: string;

@Prop()
createdAt!: Date;

@Prop()
updatedAt!: Date;

@Prop({
ref: 'TodoItemEntity',
localField: '_id',
foreignField: 'tags',
})
todoItems?: Ref<TodoItemEntity>[];

public get id(): string {
// eslint-disable-next-line no-underscore-dangle
return this._id.toHexString();
}
}
```

</TabItem>
Expand Down

0 comments on commit 50b09a0

Please sign in to comment.