A named collection of JSON documents (JsonDocument rows) owned by an organisation and optionally scoped to a website. A JsonDatabase is exposed to app developers both as a WebDAV/browsable folder tree (see the kongodb resources) and, when allowRest is set, as a REST api for reading and writing its documents. It can also be reached from server side js controllers via findDoc. The template field records which app or feature created the database and is used as a document type marker rather than a schema. Setting readonly prevents further modification of the database or its documents.
Group: Database Entities
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| allowAccess | Boolean | Whether any website in the organisation may access this database, rather than only the website it is connected to. May be null if not explicitly set. |
| allowRest | boolean | Whether this database's documents can be accessed through the REST api. |
| createdBy | Profile | The profile which created this database. |
| createdDate | Date | The date and time this database was created. Never null for a persisted database. |
| deletedBy | Profile | The profile which deleted this database, if it has been deleted. Null otherwise. |
| deletedDate | Date | The date and time this database was deleted, if it has been. Null if the database has not been deleted. |
| id | long | The primary key of this database row. |
| modifiedBy | Profile | The profile which last modified this database. |
| modifiedDate | Date | The date and time this database was last modified. Never null for a persisted database. |
| name | String | The path-safe, unique name that identifies this database within its owning organisation, used to locate it in the WebDAV tree and as its lookup key. Never null. |
| notes | String | Free text notes describing this database. May be null or empty. |
| owner | Organisation | The organisation that directly owns this database. Never null. |
| readonly | boolean | Whether this database and its documents are read only, preventing further modification. |
| template | String | The template or app type this database was created for, used as a document type marker rather than a schema. May be null for a database created without a template. |
| title | String | The user friendly display title for this database. May be null or empty. |
| website | Website | The website this database is connected to. May be null if the database is not scoped to a specific website. |
Methods
getId() · getName() · getTemplate() · getTitle() · getNotes() · getCreatedDate() · getCreatedBy() · getDeletedDate() · getDeletedBy() · getModifiedDate() · getModifiedBy() · getOwner() · getWebsite() · isAllowAccess() · isAllowRest() · isReadonly() · findDoc(String childName)
getId()
Returns: long
The primary key of this database row.
getName()
Returns: String
The path-safe, unique name that identifies this database within its owning organisation, used to locate it in the WebDAV tree and as its lookup key. Never null.
getTemplate()
Returns: String
The template or app type this database was created for, used as a document type marker rather than a schema. May be null for a database created without a template.
getTitle()
Returns: String
The user friendly display title for this database. May be null or empty.
getNotes()
Returns: String
Free text notes describing this database. May be null or empty.
getCreatedDate()
Returns: Date
The date and time this database was created. Never null for a persisted database.
getCreatedBy()
Returns: Profile
The profile which created this database.
getDeletedDate()
Returns: Date
The date and time this database was deleted, if it has been. Null if the database has not been deleted.
getDeletedBy()
Returns: Profile
The profile which deleted this database, if it has been deleted. Null otherwise.
getModifiedDate()
Returns: Date
The date and time this database was last modified. Never null for a persisted database.
getModifiedBy()
Returns: Profile
The profile which last modified this database.
getOwner()
Returns: Organisation
The organisation that directly owns this database. Never null.
getWebsite()
Returns: Website
The website this database is connected to. May be null if the database is not scoped to a specific website.
isAllowAccess()
Returns: Boolean
Whether any website in the organisation may access this database, rather than only the website it is connected to. May be null if not explicitly set.
isAllowRest()
Returns: boolean
Whether this database's documents can be accessed through the REST api.
isReadonly()
Returns: boolean
Whether this database and its documents are read only, preventing further modification.
findDoc(String childName)
Returns: JsonDocument
Looks up a document in this database by its child name, using the current session.
| Parameter | Description |
|---|---|
childName | the name of the document to look up |