본문 바로가기
TIL/TIL

Absolute vs Relative Paths/LINKS & Express _id

by koreashowme 2020. 2. 8.

상대경로 vs 절대경로

You must use absolute paths when linking to another Website, but you can also use absolute paths within your own website.

Absolute paths provide the complete website address where you want the user to go.

링크 =>

https://www.coffeecup.com/help/articles/absolute-vs-relative-pathslinks/

 

 

*Node JS 

EXPRESS DOESN'T NEED 'ID'. EXPRESS needs THE 'PARAMETER'

https://sailsjs.com/documentation/reference/request-req/req-param

 

 

Given this routeapp.get('/hi/:param1', function(req,res){ } );

and given this URL http://www.google.com/hi/there?qs1=you&qs2=tube

You will have:

req.query

{ qs1: 'you', qs2: 'tube' }

req.params

{ param1: 'there' }

 

 

The _id field is primary key for every document. It's called _id and is also accessible via id. Attempting to use an id key may result in a illegal ObjectId format error.

MongoDB assigns an _id field to each document and assigns primary index on it. 

https://stackoverflow.com/questions/9694460/difference-between-id-and-id-fields-in-mongodb/39206695

 

 

comment