linacs commented on issue #1559: RFC: Sub-Document Operations
URL: https://github.com/apache/couchdb/issues/1559#issuecomment-415578475
 
 
   I'm not familiar with Mango, can't tell...
   About 404: What I think is missing, for CouchApps, is some kind of hook to 
adapt the answer. But I think I could manage with the frontend. I give you an 
example: I use vhosts to redirect to a given document representing a school. If 
was really complicated to make a proper webpage displaying that a school is not 
existing (to avoid a CouchDB error in case of missing document!). Customising 
404 is something quite common on webservers I think. However, for this 
particular scenario with subdocuments, if 404 return a Json with the missing 
id, it would be fine to deal with I think.
   
   Here is how I use rewrites (one line extracted from my API, I have a hundred 
like this):
   
       { "from": 
"webapp/:school/api/timetables/:timetableid/teachers/:teacherid", "to": 
`"_update/api/:school", "method": "POST", "query": { "module": "timetables", 
"callback": "os_timetables_teachers_post", "access": "admin", "timetableid": 
":timetableid", "teacherid": ":teacherid" } },`
   
   So, if it can be changed to:
   `"to": "_update/api/:school/_/timetables/:timetableid/teachers/:teacherid"`
   it would be fantastatic!  :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to