Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강상위
/
my-broadcasting
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
강상위
2018-12-05 03:51:25 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
18e2adbc90abae5a9418c00710e9022e01264c47
18e2adbc
1 parent
9fca7de1
mongodb connect and test
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
48 additions
and
2 deletions
.gitignore
README.md
mongodb_connect.js
package-lock.json
package.json
.gitignore
View file @
18e2adb
node_modules
mongodb
...
...
README.md
View file @
18e2adb
...
...
@@ -4,8 +4,9 @@
-
관심있는 인물이 출연하는 방송 프로그램을 검색하여 나만의 편성표를 만든다.
## Environment
-
Backend - Node.js
-
Backend - Node.js
/ Express
-
Frontend - HTML5/CSS/Javascript
-
DB - MongoDB
## Prerequisite
-
Terminal Environment
...
...
mongodb_connect.js
0 → 100644
View file @
18e2adb
var
mongoose
=
require
(
'mongoose'
);
mongoose
.
connect
(
'mongodb://username:pwd@host/dbname'
);
var
db
=
mongoose
.
connection
;
//연결실패
db
.
on
(
'error'
,
function
(){
console
.
log
(
'Connection Failed!'
);
});
//연결 성공
db
.
once
(
'open'
,
function
()
{
console
.
log
(
'Connected!'
);
});
var
testSchema
=
mongoose
.
Schema
({
name
:
String
});
var
TestModel
=
mongoose
.
model
(
"TestModel"
,
testSchema
);
/*
var test = new TestModel({ name: "test" });
test.save(function(err, test)
{
if(err){console.log(err);}
else{console.log("Success!");}
console.log("ok4");
});
*/
TestModel
.
find
(
function
(
err
,
test
){
if
(
err
){
console
.
log
(
err
);}
else
{
console
.
log
(
test
);
}
});
//db.close()
\ No newline at end of file
package-lock.json
View file @
18e2adb
This diff is collapsed. Click to expand it.
package.json
View file @
18e2adb
...
...
@@ -15,6 +15,8 @@
"dependencies"
:
{
"cheerio"
:
"^1.0.0-rc.2"
,
"iconv"
:
"^2.3.1"
,
"request"
:
"^2.88.0"
"mongoose"
:
"^5.3.14"
,
"request"
:
"^2.88.0"
,
"selenium-webdriver"
:
"^4.0.0-alpha.1"
}
}
...
...
Please
register
or
login
to post a comment