How to use the parse-server/lib/Adapters/Storage/Mongo/MongoTransform.mongoSchemaFromFieldsAndClassNameAndCLP function in parse-server

To help you get started, we’ve selected a few parse-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benishak / parse-server-dynamodb-adapter / src / Adapter.ts View on Github external
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(