Standard
Server (GS: Java)
How to get a collection
-
var {shortenedCollectionName}shortenedCollectionName}Entry = API.getItem("{collectionName}collectionName}", {collectionKey}collectionKey}).document();var {shortenedCollectionName}shortenedCollectionName}Data = {shortenedCollectionName}shortenedCollectionName}Entry.getData();-
shortenedCollectionName = collectionName (
collectionKey)collectionKey)- eval = evaluation (studentUid)
- evalTeam = evaluationTeam (teamUid)
- result = results (simUid)
- sim = simulation (simUid)
- team = teams (teamUid)
- user = userdetails (userUid)
-
shortenedCollectionName = collectionName (
Set a Response
- use sendMessageTo{Receiver}() when MODIFY data
- messageType
- Actions
- deleted, changed, created
- {dataObject}_{field}_{action}
- ex.: team_cash_changed
- {dataObject}_{fieldOne}_{fieldTwo}_{etc.}_{action}
- ex.: sim_year_yearState_changed
- {dataObject}_{fieldParent}_{fieldChild}_{etc.}_{action}
- ex.: team_yearData_factory_changed
- Actions
- messageData
- Information you want to send to the Client.
- messageType
- use Spark.setScriptData('{ObjectName}', {Object}) when you GET data
Client (VS15.9.8: C#)