Source: site.view [edit]
Function name: getMedia
Arguments: device
Description:
Page type: webl
Render function:  
Module: sandbox

Page source:

var db = Wub_GetDB("media");
var coll = Wub_GetCollection(db, "photos");

var dbobj = Wub_NewDBObject([. device=device .]); 
var res = Wub_QueryDB(coll, dbobj, 25); // 20 = max results

// NewPage(`{ "photos": ` + WubCall("toJSON", [res]) + "}", "text/plain");
res;