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
Show whitespace changes
Inline
Side-by-side
src/models/post.model.ts
View file @
c950832d
import
{
model
,
Schema
}
from
"
mongoose
"
;
import
{
model
,
Schema
}
from
"
mongoose
"
;
export
interface
PostType
{
export
interface
PostType
extends
PostingType
{
id
:
string
;
date
?:
string
;
counts
:
number
;
id
?:
string
;
}
export
interface
PostingType
{
title
:
string
;
title
:
string
;
date
:
Date
;
text
?:
string
;
body
:
string
;
counts
?:
number
;
theme
:
string
;
theme
:
string
;
city
:
string
;
city
:
string
;
}
username
:
string
;
}
const
schema
=
new
Schema
<
PostType
>
({
const
schema
=
new
Schema
<
PostType
>
({
id
:
{
type
:
String
},
id
:
{
type
:
String
},
title
:
{
type
:
String
},
title
:
{
type
:
String
},
date
:
{
type
:
Date
},
date
:
{
type
:
Date
},
body
:
{
type
:
String
},
text
:
{
type
:
String
},
counts
:
{
type
:
Number
},
counts
:
{
type
:
Number
},
theme
:
{
type
:
String
},
theme
:
{
type
:
String
},
city
:
{
type
:
String
},
city
:
{
type
:
String
},
username
:
{
type
:
String
},
});
});
export
default
model
<
PostType
>
(
"
Post
"
,
schema
);
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