-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.js
65 lines (63 loc) · 1.63 KB
/
schema.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
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const listingsAndReviews = new Schema({
_id: Schema.Types.ObjectId,
listing_url: String,
name: String,
summary: String,
space: String,
description: String,
neighborhood_overview: String,
notes: String,
transit: String,
access: String,
interaction: String,
house_rules: String,
property_type: String,
room_type: String,
accommodates: Number,
bathrooms: Number,
bedrooms: Number,
beds: Number,
bed_type: String,
amenities: [String],
price: Number,
minimum_nights: String,
maximum_nights: String,
availability: {
availability_30: Number,
availability_60: Number,
availability_90: Number,
availability_365: Number
},
number_of_reviews: Number,
review_scores: {
review_scores_rating: Number,
review_scores_accuracy: Number,
review_scores_cleanliness: Number,
review_scores_checkin: Number,
review_scores_communication: Number,
review_scores_location: Number,
review_scores_value: Number
},
reviews: [{
_id: Schema.Types.ObjectId,
date: Date,
reviewer_name: String,
comments: String
}],
host: {
_id: Schema.Types.ObjectId,
host_name: String,
host_since: Date,
host_location: String,
host_about: String,
host_response_time: String,
host_response_rate: Number,
host_acceptance_rate: String,
host_is_superhost: Boolean,
host_thumbnail_url: String,
host_picture_url: String
}
});
module.exports = listingsAndReviews;