-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.js
More file actions
30 lines (27 loc) · 691 Bytes
/
Copy pathdb.js
File metadata and controls
30 lines (27 loc) · 691 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* Created by Suhan on 25/03/2017.
*/
var mongoose = require('mongoose');
const URLSlugs = require('mongoose-url-slugs');
// my schema goes here!
const Comment = new mongoose.Schema({
text: String,
user: String,
time:String
});
const Link = new mongoose.Schema({
//url: String,
title: String,
comment: [Comment],
vote: Number,
time: String
});
const Upvote = new mongoose.Schema({
number: Number
})
//URLSlugs('<user>');
Link.plugin(URLSlugs("_id"));
mongoose.model('Comment', Comment);
mongoose.model('Link', Link);
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://passwordis123456:123456@ds139124.mlab.com:39124/heroku_cftw89xp');