The data I entered is all in http://localhost:3000/api/region, but when I want to get one of the objects, my url becomes http://localhost:30 00/api/regions
Then I can only access individual objects like this
http://localhost:3000/api/regions/573a8752d5894fbc0ce91cbb. .
Please ask God for an answer, really. I can’t thank you enough
What you said is correct, I got the object after following
restful
定义,获取一个资源应该按照/api/regions/:regionID
这种形式没有错,这也是为什么你说使用/api/regions/573a8752d5894fbc0ce91cbb
.Storage passes
/api/region
no problem either. is right.As for what you said passed
/api/regions?_id=573a8752d5894fbc0ce91cbb
仍然是拿到了一堆数据的数组,而不是对象,很简单,就是因为我上面说的第一点,restful
里规定获取某一个资源一定要用/api/regions/:regionID
的形式,不是/api/regions?_id=:regionID