Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
travel
Commits
c950832d
Commit
c950832d
authored
Jul 08, 2022
by
Lee Soobeom
Browse files
.
parent
e7e56fda
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/models/post.model.ts
View file @
c950832d
import
{
model
,
Schema
}
from
"
mongoose
"
;
export
interface
PostType
{
id
:
string
;
title
:
string
;
date
:
Date
;
body
:
string
;
counts
?:
number
;
theme
:
string
;
city
:
string
;
}
export
interface
PostType
extends
PostingType
{
date
?:
string
;
counts
:
number
;
id
?:
string
;
}
export
interface
PostingType
{
title
:
string
;
text
?:
string
;
theme
:
string
;
city
:
string
;
username
:
string
;
}
const
schema
=
new
Schema
<
PostType
>
({
id
:
{
type
:
String
},
title
:
{
type
:
String
},
date
:
{
type
:
Date
},
body
:
{
type
:
String
},
counts
:
{
type
:
Number
},
theme
:
{
type
:
String
},
city
:
{
type
:
String
},
id
:
{
type
:
String
},
title
:
{
type
:
String
},
date
:
{
type
:
Date
},
text
:
{
type
:
String
},
counts
:
{
type
:
Number
},
theme
:
{
type
:
String
},
city
:
{
type
:
String
},
username
:
{
type
:
String
},
});
export
default
model
<
PostType
>
(
"
Post
"
,
schema
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment