-
Notifications
You must be signed in to change notification settings - Fork 0
/
Archive.js
71 lines (69 loc) · 1.6 KB
/
Archive.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
const mongoose = require('mongoose');
const { ArchiveObject } = require('./Types');
/**
* Mongoose schema defining the ArchiveObject model.
*
* @type {ArchiveObject}
*/
const ArchiveSchema = new mongoose.Schema({
ID: { type: String, required: true },
info_type: { type: String, default: 'generic' },
is_series: { type: Boolean, default: false },
is_duplicate_of: String,
shop_name: {
content: String,
content_orig: String,
content_orig_lang: String,
content_ar: String,
},
owner_name: {
content: String,
content_orig: String,
content_orig_lang: String,
content_ar: String,
},
craft_discipline_category: [String],
craft_discipline: [String],
craft_discipline_other: [String],
reference: {
// From the `ref_`-prefixed fields
name: String,
ref_type: String,
type_other: String,
location: String,
catalog: String,
link: String,
keywords: String,
citation: String,
year: String,
copyright: String,
scan: String,
},
primary_year: Number,
primary_decade: mongoose.Schema.Types.Mixed,
primary_location: {
geo: {
lat: Number,
lng: Number,
},
address: {
content: String,
content_orig: String,
content_orig_lang: String,
content_ar: String,
},
location_notes : String,
adm1: String,
adm2: String,
adm3: String,
adm4: String,
},
primary_historic_map: String,
thumb_img_id: String,
images: [String],
consent: Boolean,
object: String,
verified: Boolean
});
module.exports =
mongoose.models.Archive || mongoose.model('Archive', ArchiveSchema);