Skip to content

Commit

Permalink
Merge pull request #2 from rpt26-fec-phoenix/server
Browse files Browse the repository at this point in the history
Server
  • Loading branch information
maxmilpro authored Apr 11, 2021
2 parents 10eb927 + 35d1aab commit 492c057
Show file tree
Hide file tree
Showing 5 changed files with 3,405 additions and 192 deletions.
20 changes: 20 additions & 0 deletions database/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/airbnbMorePlaces', {useNewUrlParser: true, useUnifiedTopology: true});

const db = mongoose.connection;

const morePlacesSchema = new mongoose.Schema({
morePlaces: [Number],
propertyId: Number
});

const MorePlaces = mongoose.model('MorePlaces', morePlacesSchema);

const getMorePlaces = async (propertyId) => {
return await MorePlaces.findOne({propertyId})
};

module.exports = {
getMorePlaces
};
Loading

0 comments on commit 492c057

Please sign in to comment.