{"__v":15,"_id":"5744b74c5ab5ed0e00e33fbf","category":{"__v":0,"_id":"5744b218f9c7411700ce560e","project":"54774d9af3736008009e9e0e","version":"56a0bd9e3697d80d002ac5e7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-24T19:57:12.539Z","from_sync":false,"order":12,"slug":"classes","title":"Data Classes"},"parentDoc":null,"project":"54774d9af3736008009e9e0e","user":"56703d17e10ecb0d0004eed8","version":{"__v":20,"_id":"56a0bd9e3697d80d002ac5e7","project":"54774d9af3736008009e9e0e","createdAt":"2016-01-21T11:14:38.131Z","releaseDate":"2016-01-21T11:14:38.131Z","categories":["56a0bd9f3697d80d002ac5e8","56a0bd9f3697d80d002ac5e9","56a0bd9f3697d80d002ac5ea","56a0bd9f3697d80d002ac5eb","56b098a43a5b810d00745e3f","56b098da8f7a4f0d0029dd10","56d5a8ecf612b80b00fb69cd","570989853ab43c0e0072b2d6","571006aa10300c0e007f6133","5735a52431a73b1700887ca0","5744b0529e045c0e00b7a7a2","5744b1d0b56d431700d8a4fb","5744b1fb55d65a0e00b436e1","5744b218f9c7411700ce560e","5744b220f9c7411700ce560f","5744b2259e045c0e00b7a7a7","5744b22cf8b79f0e00de6a2d","5744b23155d65a0e00b436e4","5744b242c758290e00fbc235","5744b2569e045c0e00b7a7a8","5756a3f2bb92962900dafe3d","57ee23e81e42900e0014a42f","581c822c98676e0f00d240ef"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Sockets","version_clean":"1.1.0","version":"1.1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-24T20:19:24.650Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Chapter sections:\n1. [Overview](#overview)\n2. [Data Class Status](#class-status)\n3. [Data Objects count](#data-objects-count)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Overview\"\n}\n[/block]\n**Data Classes** are templates for data objects you will store in Syncano. In order to be able to [add Data Objects](doc:data-objects#creating-a-data-object), you have to define a **Data Class** for that type of data object. To [create a Data Class](doc:classes-creating-a-class) you have to provide:\n\n- The name of the class\n- A description (optional)\n- A schema\n\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Limits\",\n  \"body\": \"For paid accounts, maximum number of Data Classes that can be created within an Instance is `100`.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Data Class Status\"\n}\n[/block]\nEach Data Class has a status, which is one of two values:\n- `ready` - means that the Data Class is ready and Data Objects can be created within the Data Class.\n- `migrating` - Data Class schema and relations are being set up. It's not possible to create Data Objects within the Data Class.\n\nA Data Class can have a `migrating` status in two situations:\n- after the Data Class was created\n- after the Data Class schema was edited.\n\nData Class migrations usually don't take longer than a couple of seconds. If your app doesn't rely on editing or creating Data Classes, you won't be affected by this behavior.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Data Objects count\"\n}\n[/block]\nAs mentioned in the beginning of this chapter, Data Classes define a structure for the Data Objects to base their properties on. Another cool feature of Data Classes, is that you can see a number of Data Objects that inherit from the Data Class.\n\nTo see that, go to `Dashboard` -> `Data Classes` view. The `Objects` column on the Data Classes list will tell you the current number of Data Objects:\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/HdpHJEYPSEHQh2qnB6OA_classes_foo.png\",\n        \"classes_foo.png\",\n        \"2050\",\n        \"699\",\n        \"#265eb5\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nAs you can see, there are `5` Objects in the Data Class called, wait for it.. `class`!\n\nWhat can be a bit more surprising is the object count for the `trigger` Data Class -- which is `~ 48837`. The `~` sign shows that this is an _estimation_. Syncano shows an estimate count for Data Classes that have more than 1000 Data Objects.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Did you know?\",\n  \"body\": \"You can also get count of Data Objects using our API, when making a call directly to the Data Objects endpoint! \\nSee the [Data Objects](doc:data-objects) chapter for details.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Learn More\",\n  \"body\": \"For more details about the available methods for Data Classes, visit the [Data Classes API reference](http://docs.syncano.com/v0.1.1/docs/classes-list).\"\n}\n[/block]","excerpt":"In this chapter you will learn what Data Classes are, as well as how to use them","slug":"classes-overview","type":"basic","title":"Overview"}

Overview

In this chapter you will learn what Data Classes are, as well as how to use them

Chapter sections: 1. [Overview](#overview) 2. [Data Class Status](#class-status) 3. [Data Objects count](#data-objects-count) [block:api-header] { "type": "basic", "title": "Overview" } [/block] **Data Classes** are templates for data objects you will store in Syncano. In order to be able to [add Data Objects](doc:data-objects#creating-a-data-object), you have to define a **Data Class** for that type of data object. To [create a Data Class](doc:classes-creating-a-class) you have to provide: - The name of the class - A description (optional) - A schema [block:callout] { "type": "info", "title": "Limits", "body": "For paid accounts, maximum number of Data Classes that can be created within an Instance is `100`." } [/block] [block:api-header] { "type": "basic", "title": "Data Class Status" } [/block] Each Data Class has a status, which is one of two values: - `ready` - means that the Data Class is ready and Data Objects can be created within the Data Class. - `migrating` - Data Class schema and relations are being set up. It's not possible to create Data Objects within the Data Class. A Data Class can have a `migrating` status in two situations: - after the Data Class was created - after the Data Class schema was edited. Data Class migrations usually don't take longer than a couple of seconds. If your app doesn't rely on editing or creating Data Classes, you won't be affected by this behavior. [block:api-header] { "type": "basic", "title": "Data Objects count" } [/block] As mentioned in the beginning of this chapter, Data Classes define a structure for the Data Objects to base their properties on. Another cool feature of Data Classes, is that you can see a number of Data Objects that inherit from the Data Class. To see that, go to `Dashboard` -> `Data Classes` view. The `Objects` column on the Data Classes list will tell you the current number of Data Objects: [block:image] { "images": [ { "image": [ "https://files.readme.io/HdpHJEYPSEHQh2qnB6OA_classes_foo.png", "classes_foo.png", "2050", "699", "#265eb5", "" ] } ] } [/block] As you can see, there are `5` Objects in the Data Class called, wait for it.. `class`! What can be a bit more surprising is the object count for the `trigger` Data Class -- which is `~ 48837`. The `~` sign shows that this is an _estimation_. Syncano shows an estimate count for Data Classes that have more than 1000 Data Objects. [block:callout] { "type": "info", "title": "Did you know?", "body": "You can also get count of Data Objects using our API, when making a call directly to the Data Objects endpoint! \nSee the [Data Objects](doc:data-objects) chapter for details." } [/block] [block:callout] { "type": "info", "title": "Learn More", "body": "For more details about the available methods for Data Classes, visit the [Data Classes API reference](http://docs.syncano.com/v0.1.1/docs/classes-list)." } [/block]