-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmongoose.js
54 lines (53 loc) · 1.07 KB
/
mongoose.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const mongoose = require('mongoose')
const Schema = mongoose.Schema
const url_local = 'mongodb://127.0.0.1/research_paper'
// const url_atlas = 'mongodb+srv://myoffice:[email protected]/research_paper?retryWrites=true&w=majority'
const url_atlas =
'mongodb+srv://zhutiannian:[email protected]/research_paper?retryWrites=true&w=majority'
mongoose.connect(url_atlas)
const paperSchema = new Schema({
link: {
type: String,
required: true
},
title: {
type: String,
required: true
},
authors: {
type: Array,
required: true
},
institutes: {
type: Array,
required: true
},
DOI: {
type: String,
required: true
},
abstract: {
type: String,
required: true
},
date: {
type: Object,
required: true
},
areas: {
type: Array,
required: true
},
publication: {
type: String,
required: true
},
keywords: {
type: Array
},
topo_label: {
type: Number
}
})
const Paper = mongoose.model('Paper', paperSchema)
module.exports = Paper