Created
November 1, 2018 22:21
-
-
Save pkosiec/a2f32dc0f7404e47ba2981a2c34ddfc0 to your computer and use it in GitHub Desktop.
Example MongoDB document in TypeScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Person } from '../../models'; | |
const people: Person[] = [ | |
{ | |
name: "John", | |
email: "john@mail.de", | |
age: 18, | |
}, | |
{ | |
name: "Bob", | |
emial: "bob@example.com", // <-- error underlined in IDE | |
age: "none", // <-- error underlined in IDE | |
}, | |
]; | |
export = people; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export interface Person { | |
name: string; | |
email: string; | |
age: number; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment