Initial Release
Sample for SQL methods JSON_OBJECT and JSON_ARRAY
This package is inspired by the broken package JSONExportManyToMany
The major difference is that instead of adding %JSONAdaptor to each class
I used SQL functions to create my JSON objects.
By this approach, you can add JSON to any class - even deployed ones -
without any need for change or recompile.
Additional features
Make sure you have git and Docker desktop installed.
Clone/git pull the repo into any local directory
git https://github.com/rcemper/JSONExport-ManyToMany-AD.git
Build the container with your project:
docker compose --progress plain build
Run the container
docker compose up -d
To follow the startup you may use
docker compose logs -f
Demo-data are imported from a previous package
It’s an extract from members in the Developer Community and the Badges available in GlobalMasters
Real names are scrambled.
Besides the straight projection of Members or Badges as Array of JSON objects
There is also
After installing this sample, the following two commands can be run from terminal or console
docker-compose exec iris iris session iris
select top 10 %ID,BadgeCount from dc_data_rcc.DCmember
where BadgeCount>2 order by badgecount
-
select top 10 %ID,MbCnt from dc_data_rcc.GMbadge
where MbCnt>3 order by 2
Provide ID and a Verbose switch for immediate display
set b=##class(dc.data.rcc.JSON).byBadge(47,1)
Provide ID instead of Verbose switch use explicit view
set res=##class(dc.data.rcc.JSON).byMember(9976)
zzjson res
All you may provide is the Verbose switch
set badges=##class(dc.data.rcc.JSON).allBadges(1)
Provide minimal badge count and a Verbose switch for immediate display
set badges=##class(dc.data.rcc.JSON).activeMembers(40,1)