Object Definition
Last updated
Last updated
In Accelerator platform, objects are logical representations of data that can be stored and retrieved by a software application. Object metadata, which defines the attributes of the object, is stored in a MongoDB collection called "objects" within the organization database.
When creating an object, users can add fields to the object, defining the data types and properties of the field. In addition, users can define validation rules and business logic for each field, ensuring that the data stored in the object is accurate and consistent.
The validation rules and business logic are defined using scripts that are executed by the Accelerator platform. These scripts can check that the data being entered into the object meets specific criteria, such as ensuring that a field contains a valid email address or that a field value is within a specified range. The scripts can also perform more complex operations, such as manipulating data in one field based on the value of another field.
Overall, objects provide a flexible and powerful way to store and manage data within a software application. By defining the structure of the data and allowing for validation and business logic, objects help to ensure that the data stored in the software application is accurate, consistent, and meaningful.
Below are the list of the attributes or fields that Accelerator platform offers :
_id
ObjectId
This is the unique identifier of the object.
name
String
Every Object name is unique in an organization. It should be in the camelCase format. We can use this name to get data from the object.
label
String
This describes the object
containsUsers
Boolean
This is an optional attribute. However, if the objective is to store additional user information in an Object, then this value must be set to true. This will allow the user to create an Item in the object in which the _id will be the same as the logged-in user, thereby enforcing a one-to-one relationship between the βusersβ collection in the auth database and the item collection of the object.
enableVersionHistory
Boolean
When this optional field is set to true, the system generates a read-only array field named '_versionHistory' and a read-only string field named '_version' within each item of the Object. The '_version' field begins with '1.0' and increments by 0.1 with each update made to the item. As a result, the previous version of the item is added to the '_versionHistory', allowing users to track the changes made to it.
fields
ObjectArray
"The 'fields' attribute is an array that contains the definitions for all the fields associated with an object. These fields have common attributes such as _id, name, label, type, and validators. The _id and name is unique within an Object. In the case of a choice field, an additional attribute called 'options' is included, which is a string array that lists all the available options.
_createdAt
Date
This is the date and time when the object was created.
_createdBy
String
This is the email of the user who created the object.
_modifiedAt
Date
This is the date and time when the object was last modified.
_modifiedBy
String
This is the email of the user who last modified the object.
_collectionName
String
This is the name of the item collection where the object data is stored. The item collection follows a specific syntax: <first_8_characters_of_object_name>_<object_id>
Example creating a object named as DocumentApprover which contains multiple Fields in it. .