Source: site.view [edit]
Function name: printDB
Arguments:
Description:
Page type: webl
Render function:  
Module: demavu

Page source:

var db = Wub_GetDB("demavu");

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


var query = [. .];
if Size(OPTIONALARGS) > 0 then
   query["server"] := OPTIONALARGS[0]
end;

var queryObj = Wub_NewDBObject(query);

var objs = Wub_QueryDB(coll, queryObj, 50000);

var s = "[ ";
every obj in objs do
   DeleteField(obj, "_id");
   var val = obj.value ? "";
   if Stringp(val) and val != "" then
      obj.value := Wub_ReplaceAll(val, `"`, "'");
   end;
   s = s + ToString(obj) + ",\n";
end;

if Size(s) > 2 then
   s = Select(s, 0, Size(s)-2)
end;

s + " ];\n";