Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이나경
/
time_table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
송민석
2022-06-03 16:00:52 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
29d51948c6390a098236b27a55c520a0d9eb1729
29d51948
1 parent
df9738fa
Make DB Shcema
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
index.js
index.js
View file @
29d5194
const
config
=
require
(
'./config'
)
const
mongoose
=
require
(
"mongoose"
);
const
connect
=
mongoose
.
connect
(
config
.
url
,
{
const
connect
=
mongoose
.
connect
(
config
.
url
,
{
useNewUrlParser
:
true
,
useUnifiedTopology
:
true
,
})
.
then
(()
=>
console
.
log
(
"MongoDB Connected ..."
))
.
catch
((
err
)
=>
console
.
log
(
err
));
\ No newline at end of file
.
then
(()
=>
console
.
log
(
"DB : Succesfully Connected"
))
.
catch
((
err
)
=>
console
.
log
(
err
.
message
));
const
TimeSchema
=
new
mongoose
.
Schema
({
time
:
String
,
prof
:
String
,
credit
:
Number
,
});
const
SubSchema
=
new
mongoose
.
Schema
({
campus
:
String
,
college
:
String
,
department
:
String
,
grade
:
String
,
subject
:
[
TimeSchema
],
});
const
Timeinfo
=
mongoose
.
model
(
'Timeinfo'
,
TimeSchema
);
const
Subinfo
=
mongoose
.
model
(
'Subinfo'
,
SubSchema
);
module
.
exports
=
{
Timeinfo
,
Subinfo
};
...
...
Please
register
or
login
to post a comment