This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const userSchema = new Schema({ | |
username: String, | |
picture: { type: String, default: "https://domain.com/some-pic.png" }, | |
googleId: String, | |
facebookId: String | |
}); | |
userSchema.index({ username: 1 }); | |
userSchema.index({ googleId: 1 }); | |
userSchema.index({ facebookId: 1 }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const postSchema = new Schema({ | |
type: { type: String, enum: ['blurb', 'image', 'video'] }, | |
blurb: { type: String, required: true }, | |
media: String, | |
user: { | |
id: { type: ObjectId, ref: 'user', required: true }, | |
username: String, | |
picture: String | |
}, | |
created: { type: Date } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.1" | |
# Our containers | |
services: | |
# Temporary container used to initialize the replica set | |
mongo-setup: | |
container_name: mongo-setup | |
image: mongo | |
restart: on-failure | |
networks: |