We are trying to add a class, we are using the following method and the code does not pass the line. No error is printed. Please advise.
var mySchema = new Parse.Schema(‘MyClass’);
We are currently on Parse server version 2.7.2
We are trying to add a class, we are using the following method and the code does not pass the line. No error is printed. Please advise.
var mySchema = new Parse.Schema(‘MyClass’);
We are currently on Parse server version 2.7.2
Here is an example from docs:
// create an instance to manage your class
const mySchema = new Parse.Schema('MyClass');
// gets the current schema data
mySchema.get();
// returns schema for all classes
Parse.Schema.all()
// add any # of fields, without having to create any objects
mySchema
.addString('stringField')
.addNumber('numberField')
.addBoolean('booleanField')
.addDate('dateField')
.addFile('fileField')
.addGeoPoint('geoPointField')
.addPolygon('polygonField')
.addArray('arrayField')
.addObject('objectField')
.addPointer('pointerField', '_User')
.addRelation('relationField', '_User');
// new types can be added as they are available
mySchema.addField('newField', 'ANewDataType')
// save/update this schema to persist your field changes
mySchema.save().then((result) => {
// returns save new schema
});
// or
mySchema.update().then((result) => {
// updates existing schema
});
How can I define ANewDataType?