Skip to content

DB models

Ramesh syangtan edited this page Dec 17, 2017 · 3 revisions

1. Users collection

user: {
	_id: ObjectId,
	name: String,
	avatar: ??url??,
	bio: String,
	social_links:['github', 'twitter', 'fb'],
	website: String,
	stories: [ObjectIds] // referencing stories collection,
	bookmarks: [ObjectIds] // stories collection reference,
	
}

Stories Collection

story: {
        _id: ObjectId,
	title: String,
	feature_img: ??url??,
	content: String,
        date: Date,
	author: ObjectId of user,
	tags: [String],
        upvotes: Number
}
Clone this wiki locally