Source: site.view [edit]
Function name: searchHistory
Arguments:
Description:
Page type: webl
Render function:   speakaboutai.searchHistoryRender
Module: speakaboutai

Page source:

var db = Wub_GetDB("speakaboutai");

var coll = Wub_GetCollection(db, "searchHistory");

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

var sorted = Sort(res, fun(a,b)
   if (ToInt(a["count"]) < ToInt(b["count"])) then 1
   elsif a["count"] == b["count"] then 0
   else -1
   end end);


// You can drop an entire database:
// Wub_DropDB("speakaboutai");