DOCUMENTS_FROM_VIEW_BY_KEY Strategy
DOCUMENTS_FROM_VIEW_BY_KEY or DOCUMENTS_FROM_VIEW_BY_KEY_PAGED
The route entry in the groovy document looks like this:
Route DOCUMENTS_FROM_VIEW_BY_KEY
router.GET('serversbycategory/{category}', {
strategy (DOCUMENTS_FROM_VIEW_BY_KEY) {
databaseName('names.nsf')
viewName('Servers')
keyVariableName("category")
runAsSigner(true)
}
mapJson 'UNID', json:'unid', type:'STRING', isformula:true, formula:'@Text(@DocumentUniqueID)'
mapJson 'Form', json:'form', type:'STRING'
mapJson 'Created', json:'Created', type:'DATETIME', isformula:true, formula:'@Created'
mapJson 'Modified', json:'Modified', type:'DATETIME', isformula:true, formula:'@Modified'
mapJson 'Type', json:'type', type:'STRING'
})
URL to call
http://localhost/rest/myfirst.nsf/xsp/.xrest/serversbycategory/catname
Test with postman