My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

How do you create database design or Schema with Express for Rest API

Default profile photo
Anonymous
·Dec 6, 2017

Hello I'm new with backend development since i'm more UI Design and I'm trying to explore and learn backend stuff for javascript which is Express.JS for Rest API to build my side projects.

I have a question how do you create your Database Design? Since it's NoSQL. since i'm only familiar with SQL like PostgreSQL. I'm trying to build an api for Restaurant listing.

Here is my things this is based from ruby on rails

Restaurant (has_many -> )Collection 'it's like Best Ramen in City'
Location (has_many -> )Restaurants
Restaurant (has_one -> )MenuList
Menu (has_many -> )MenuItem

and more. I already try with the mongoose populate but i'm not sure i'm right. something like this

collections [{ Type: Schema.Types.ObjectId, ref: restaurant }]

If you are willing to give a tips or give me an insights for this. You can post your answer here sorry if my english and grammar are correct :)