Custom Entity
Overview
Custom Entities are very similar to Global Entities, but with several advanced features that make them more applicable for larger data sets.
Like Global Entities, Custom Entites are:
- available across all users of an app
- access is controlled via ACL
- have an
entityTypefor organization - can have
ownersor be un-owned (as system objects) - can be automatically deleted via TTL (time-to-live)
Custom Entities differ in these ways:
- You must pre-declare your
entityTypesahead-of-time - You can create custom indexes for each
entityTypefor fast lookups - You can have an unlimited # of custom entities
- You can do partial updates of custom entities
- Custom entities support auto-migration during deployment
Custom Entities supports text index, $text operator can be use to query document fields once a text index is set up. Note that as the MongoDB restriction, one collection can have only one text index.
{
"entityType": "questions",
"context": {
"pagination": {
"rowsPerPage": 50,
"pageNumber": 1
},
"searchCriteria": {
"$text":{"$search": "moon"}
},
"sortCriteria": {
"createdAt": 1
}
}
}
Custom Entities are a premium feature available to Plus Plan customers. Additional usage fees apply.
API Summary
Basic Access
- CreateEntity - Creates new custom entity.
- DeleteEntity - Deletes the specified custom entity on the server.
- DeleteEntities - Deletes all applicable custom entities from the server based on the custom entity type and specified delete criteria.
- DeleteSingleton - Deletes the specified custom entity singleton, owned by the session's user, for the specified entity type, on the server.
- IncrementData - Increments the specified fields by the specified amount within custom entity data on the server.
- IncrementDataSharded - Increments the specified fields by the specified amount within custom entity data on the server, enforcing ownership/ACL permissions.
- IncrementSingletonData - Increments the specified fields, of the singleton owned by the user, by the specified amount within the custom entity data on the server.
- ReadEntity - Reads a custom entity.
- ReadSingleton - Reads the custom entity singleton owned by the session's user.
- UpdateEntity - Replaces the specified custom entity's data, and optionally updates the acl and expiry, on the server.
- UpdateEntityFields - Sets the specified fields within custom entity data on the server.
- UpdateEntityFieldsSharded - For sharded custom collection entities. Sets the specified fields within custom entity data on the server, enforcing ownership/ACL permissions.
- UpdateSingleton - Updates the singleton owned by the user for the specified custom entity type on the server, creating the singleton if it does not exist. This operation results in the owned singleton's data being completely replaced by the passed in JSON object.
- UpdateSingletonFields - Partially updates the data, of the singleton owned by the user for the specified custom entity type, with the specified fields, on the server.
Paging
- GetCount - Counts the number of custom entities meeting the specified where clause.
- GetEntityPage - Retrieves first page of custom entities from the server based on the custom entity type and specified query context.
- GetEntityPageOffset - Gets the page of custom entities from the server based on the encoded context and specified page offset.
- GetRandomEntitiesMatching - Gets a list of up to maxReturn randomly selected custom entities from the server based on the entity type and where condition.
Bypassing ACL for System Objects
- SysCreateEntity - Creates new custom entity.
- SysDeleteEntity - Deletes the specified custom entity on the server.
- SysDeleteEntities - Deletes all applicable custom entities from the server based on the custom entity type, specified delete criteria and acrossAllUsers flag.
- SysGetCount - Counts the number of custom entities meeting the specified where clause.
- SysGetEntityPage - Retrieves first page of custom entities from the server based on the custom entity type and specified query context
- SysGetEntityPageOffset - Gets the page of custom entities from the server based on the encoded context and specified page offset.
- SysGetRandomEntitiesMatching - Gets a list of up to maxReturn randomly selected custom entities from the server based on the entity type and where condition, bypassing ownership/ACL permissions checking.
- SysIncrementData - Increments the specified fields by the specified amount within custom entity data on the server.
- SysIncrementData - Increments the specified fields by the specified amount within custom entity data on the server, bypassing ownership/ACL permissions checks.
- SysIncrementDataSharded - Increments the specified fields by the specified amount within custom entity data on the server, bypassing ownership/ACL permissions.
- SysReadEntity - Reads a custom entity.
- SysUpdateEntity - Replaces the specified custom entity's data, and optionally updates the acl and expiry, on the server.
- SysUpdateEntityFields - Sets the specified fields within custom entity data on the server.
- SysUpdateEntityFieldsSharded - For sharded custom collection entities. Sets the specified fields within custom entity data on the server, bypassing ACL permissions checks.
- SysUpdateEntityOwner - Updates the owner of the custom entity.
Schema Management
- SysCreateCollection - Creates configuration for new custom entity collection.
- SysCreateIndex - Creates a new index on a custom entity collection.
- SysDropCollection - Drops the specified custom entity collection.
- SysDropIndex - Drops the specified index from the identified custom entity collection.
- SysListCollections - Lists the custom entity collections configured for the application.
- SysListIndexes - Retrieves list of indexes configured for a custom entity collection.
- SysUpdateCollectionMigrate - Updates the migration flag for the custom entity collection.
📄️ CreateEntity
Overview
📄️ DeleteEntities
Overview
📄️ DeleteEntity
Overview
📄️ DeleteSingleton
Overview
📄️ GetCount
Overview
📄️ GetEntityPage
Overview
📄️ GetEntityPageOffset
Overview
📄️ GetRandomEntitiesMatching
Overview
📄️ IncrementData
Overview
📄️ IncrementDataSharded
Overview
📄️ IncrementSingletonData
Overview
📄️ ReadEntity
Overview
📄️ ReadSingleton
Overview
📄️ SysCreateCollection
Overview
📄️ SysCreateEntity
Overview
📄️ SysCreateIndex
Overview
📄️ SysDeleteEntities
Overview
📄️ SysDeleteEntity
Overview
📄️ SysDropCollection
Overview
📄️ SysDropIndex
Overview
📄️ SysDropIndexNamed
Overview
📄️ SysGetCount
Overview
📄️ SysGetEntityPage
Overview
📄️ SysGetEntityPageOffset
Overview
📄️ SysGetRandomEntitiesMatching
Overview
📄️ SysIncrementData
Overview
📄️ SysIncrementDataSharded
Overview
📄️ SysListCollections
Overview
📄️ SysListIndexes
Overview
📄️ SysReadEntity
Overview
📄️ SysUpdateCollectionMigrate
Overview
📄️ SysUpdateCollectionOptions
Overview
📄️ SysUpdateEntity
Overview
📄️ SysUpdateEntityFields
Overview
📄️ SysUpdateEntityFieldsSharded
Overview
📄️ SysUpdateEntityOwner
Overview
📄️ UpdateEntity
Overview
📄️ UpdateEntityFields
Overview
📄️ UpdateEntityFieldsSharded
Overview
📄️ UpdateSingleton
Overview
📄️ UpdateSingletonFields
Overview