File Data type
const schema = new Schema({ images: { type: String } })
Last updated
const schema = new Schema({ images: { type: String } })
Last updated
Required: If you choose this option, it means that users must fill in the required fields before submitting data to the database. This ensures that all necessary information is collected and avoids submitting incomplete data. It prompts users to provide input in the designated fields that must be filled.
Ex. It will not take blank fields in the database
isPrivate: If you choose this option, it means that the system will keep the information entered in that field confidential and hidden from the user. This option is especially helpful when collecting sensitive data that should not be visible to the user.
Ex. It will not be visible to the user in the response
isArray: If you choose this option, it means the selected field will be set up as an array. This option is helpful when storing multiple items as a single entity.
Ex. It will take an array in the field.
unique: If you choose this option, it means that the system will require each value in that field to be different from the others. This is useful when you want to avoid duplicates in specific data fields.
Ex. when the user adds added value for that field, it won't allow taking that value again.
Searchable: If you choose this option, it means that it can be used to search for specific information in the database by functioning as a query criterion. For example, if you mark a userβs name field as searchable, users can search for other users by their name.
Ex. we can search with this field for matching documents.
Sortable: If you choose this option, it means that the field becomes eligible for use in sorting the elements of a collection resource in either ascending or descending order, enhancing the efficiency of data retrieval and organization.
Ex. it will sort the documents by selected field when we search the documents.
Allowed Extensions:- If you choose this option, it means that you can only select the file extension from the allowed extensions list. This helps keep your data safe and consistent by preventing users from uploading risky files. Just remember to choose at least one extension from the list, even if you choose to allow all extensions.
Max File Size (in MB):- If you choose this option, it means that you will be able to define a maximum size limit for your files, based on your specific requirements. The system will restrict file uploads to be within this size limit, ensuring that data integrity is maintained and that the system's resources are not overloaded. It is important to note that the maximum file size that can be specified in this option is 1024 MB.