Skip to content

Instantly share code, notes, and snippets.

@pkosiec
Created November 1, 2018 22:21
Show Gist options
  • Save pkosiec/a2f32dc0f7404e47ba2981a2c34ddfc0 to your computer and use it in GitHub Desktop.
Save pkosiec/a2f32dc0f7404e47ba2981a2c34ddfc0 to your computer and use it in GitHub Desktop.
Example MongoDB document in TypeScript
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;
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