Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
partition => {
if (!partition) {
schema = Transform.convertParseSchemaToMongoSchema(schema);
const mongoObject = Transform.mongoSchemaFromFieldsAndClassNameAndCLP(schema.fields, className, schema.classLevelPermissions);
mongoObject._id = className;
return this._schemaCollection().insertOne(mongoObject)
.then(
result => {
return mongoSchemaToParseSchema(result.ops[0]);
}
)
.catch(
error => { throw error; }
)
} else {
throw new Parse.Error(Parse.Error.DUPLICATE_VALUE, 'Class already exists.');
}
}
).catch(