A Collection exposes a database-like API directly to clients over HTTP and WebSockets. Clients can run advanced queries, create and update objects, and listen for realtime messages to sync with the Collection when it updates. You can create a Collection in the dashboard by clicking the "Resources +" button in the sidebar, and choosing "Collection".
Every Collection requires a set of properties that describe the data it can store. By default every object in a Collection is created with an
id. If an object being
PUT into a Collection includes properties or values that don't match what the collection allows, they will be ignored. The following property types are available when creating a Collection:
Number- Stores numeric values, including floating points.
Boolean- Either true or false. (To avoid confusion, Deployd will consider null or undefined to be false)
Object- Stores any JSON object. Useful for storing arbitrary data on an object without needing to validate schema.
Array- Stores an array of any type.
Once you create a Collection from the dashboard, you can add and edit its data using the data editor. The data editor is designed to edit all sorts of data, including objects and arrays.
Double-click in a cell to start editing. Press Enter to save your changes, or Escape to cancel and undo your changes.
While editing a string property, click the "edit" icon next to the field to open up a multiline editor.
Click the trash can icon in any row to delete it.
Edit the bottom-most row to create a new object. Press Enter when editing a property to save the row, or click the checkmark in the margin.