Skip to content

Why not use object to store schema type #5195

Closed
@xVanTuring

Description

@xVanTuring

Describe the solution you'd like
Currently parse server uses a string to set the schema type in mongo _SCHEMA, making it difficult to make additional settings such as required
If we use an Object, it will be easy to add an isRequired option.
And I tried this and modified a few functions, the parse server can create objects, and schema,The rest is still unclear.

Bottom it's the schema of the GameObject
tim 20181127143526

Function I edited

// MongoSchemaCollection.js
function mongoFieldToParseSchemaField(type) {
   return type;
}
function parseFieldTypeToMongoFieldType(fieldType) {
 return fieldType;
}
// MongoStorageAdapter.js
const mongoSchemaFromFieldsAndClassNameAndCLP=(/**/)=>{
  const mongoObject = {
    _id: className,
    objectId: {type:'String'}, //objectId: 'string',
    updatedAt: {type:'String'},
    createdAt: {type:'String'},
    _metadata: undefined,
  };
}

Hope this is useful

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions