1,007
edits
Line 167: | Line 167: | ||
* columns: An array of objects, each describing a single database column. Each column corresponds to one property on the event objects that you plan to pass in to storeEvent(). The properties that each column object must specify are as follows: | * columns: An array of objects, each describing a single database column. Each column corresponds to one property on the event objects that you plan to pass in to storeEvent(). The properties that each column object must specify are as follows: | ||
** property: What property of the event object will be mapped to this column. For example, if you plan to pass in event objects that have a .timestamp property, then you will want a column object with property: "timestamp". | ** property: What property of the event object will be mapped to this column. For example, if you plan to pass in event objects that have a .timestamp property, then you will want a column object with property: "timestamp". | ||
** type: A code specifying the data storage type of the column. | ** type: A code specifying the data storage type of the column. Supported types are TYPE_INT_32, TYPE_DOUBLE, and TYPE_STRING which are all defined in '''study_base_classes.js'''. | ||
** displayName: The human-readable name that will be used to label this column whenever we display database contents. Can have spaces. Should be Title Cased. | ** displayName: The human-readable name that will be used to label this column whenever we display database contents. Can have spaces. Should be Title Cased. | ||
** displayValue (optional): If not provided, then the raw value that is stored will be what is displayed whenever we display database contents. If it is provided, it tells the client how to display the contents of this column. It must be either an array of strings, or a function that returns a string. If it's a function, the raw value will be passed into the function and the return value will be what's displayed. If it's an array, the raw value will be used as an index into the array, and the string at that index will be what's displayed (useful for enumerated type codes). | ** displayValue (optional): If not provided, then the raw value that is stored will be what is displayed whenever we display database contents. If it is provided, it tells the client how to display the contents of this column. It must be either an array of strings, or a function that returns a string. If it's a function, the raw value will be passed into the function and the return value will be what's displayed. If it's an array, the raw value will be used as an index into the array, and the string at that index will be what's displayed (useful for enumerated type codes). |
edits