DOCUMENTS_BY_VIEW Strategy
Here you have as well the possibilities to call the result paged.
DOCUMENTS_BY_VIEW or DOCUMENTS_BY_VIEW_PAGED
The route entry in the groovy document looks like this:
Route DOCUMENTS_BY_VIEW
router.GET('groups', {
strategy (DOCUMENTS_BY_VIEW) {
databaseName('names.nsf')
viewName('Groups')
runAsSigner(true)
}
mapJson 'UNID', json:'unid', type:'STRING', isformula:true, formula:'@Text(@DocumentUniqueID)'
mapJson 'Form', json:'form', type:'STRING'
mapJson 'ListCategory', json:'category', type:'STRING'
mapJson 'ListName', json:'groupname', type:'STRING'
mapJson 'Type', json:'type', type:'STRING'
mapJson 'Members', json:'members', type:'ARRAY_OF_STRING'
})
URL to test
http://localhost/rest/myfirst.nsf/xsp/.xrest/groups
Test with postman