Constructor
new Schema(className)
Parameters:
Name | Type | Description |
---|---|---|
className |
string
|
Parse Class string. |
Methods
addArray(name, options) → {Parse.Schema}
Adding Array Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addBoolean(name, options) → {Parse.Schema}
Adding Boolean Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addBytes(name, options) → {Parse.Schema}
Adding Bytes Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addDate(name, options) → {Parse.Schema}
Adding Date Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addField(name, type, options) → {Parse.Schema}
Adding a Field to Create / Update a Schema
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
type |
string
|
Can be a (String|Number|Boolean|Date|Parse.File|Parse.GeoPoint|Array|Object|Pointer|Parse.Relation) |
options |
object
|
Valid options are:
|
addFile(name, options) → {Parse.Schema}
Adding File Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addGeoPoint(name, options) → {Parse.Schema}
Adding GeoPoint Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addIndex(name, index) → {Parse.Schema}
Adding an Index to Create / Update a Schema
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the index |
index |
object
|
{ field: value } |
Returns:
- Type:
-
Parse.Schema
Returns the schema, so you can chain this call.
schema.addIndex('index_name', { 'field': 1 });
addNumber(name, options) → {Parse.Schema}
Adding Number Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addObject(name, options) → {Parse.Schema}
Adding Object Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addPointer(name, targetClass, options) → {Parse.Schema}
Adding Pointer Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
targetClass |
string
|
Name of the target Pointer Class |
options |
object
|
See addField |
addPolygon(name, options) → {Parse.Schema}
Adding Polygon Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
addRelation(name, targetClass) → {Parse.Schema}
Adding Relation Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
targetClass |
string
|
Name of the target Pointer Class |
addString(name, options) → {Parse.Schema}
Adding String Field
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field that will be created on Parse |
options |
object
|
See addField |
delete() → {Promise}
Removing a Schema from Parse Can only be used on Schema without objects
Returns:
- Type:
-
Promise
A promise that is resolved with the result when the query completes.
deleteField(name) → {Parse.Schema}
Deleting a Field to Update on a Schema
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field |
deleteIndex(name) → {Parse.Schema}
Deleting an Index to Update on a Schema
Parameters:
Name | Type | Description |
---|---|---|
name |
string
|
Name of the field |
get() → {Promise}
Get the Schema from Parse
Returns:
- Type:
-
Promise
A promise that is resolved with the result when the query completes.
purge() → {Promise}
Removes all objects from a Schema (class) in Parse. EXERCISE CAUTION, running this will delete all objects for this schema and cannot be reversed
Returns:
- Type:
-
Promise
A promise that is resolved with the result when the query completes.
save() → {Promise}
Create a new Schema on Parse
Returns:
- Type:
-
Promise
A promise that is resolved with the result when the query completes.
setCLP(clp) → {Parse.Schema}
Sets Class Level Permissions when creating / updating a Schema. EXERCISE CAUTION, running this may override CLP for this schema and cannot be reversed
Parameters:
Name | Type | Description |
---|---|---|
clp |
object
|
Parse.CLP
|
Class Level Permissions |
update() → {Promise}
Update a Schema on Parse
Returns:
- Type:
-
Promise
A promise that is resolved with the result when the query completes.
(static) all() → {Promise}
Static method to get all schemas
Returns:
- Type:
-
Promise
A promise that is resolved with the result when the query completes.