The Database Hub | Back4App
The Database Hub | Back4App
How it works
  • Log In
  • Sign Up

  1. Back4App
  2. Complete User Registration
Public

32
51
32
51
  • DatabaseDatabase
  • GraphQL API PlaygroundAPI Playground
  • Get Started GuideGet Started
  • IssuesIssues
  • ContributorsContributors
  • GraphQL API Playground
    API Playground
    Get Started Guide
    Get Started
    Issues
    Issues
    Contributors
    Contributors

  1. Complete User Registration
  2. MandatoryFields

The MandatoryFields class holds the values of Classes/Properties pairs that will be validated using Cloud Code to ensure only the correct data will be stored.


DataSchema
Get StartedFetch Data
classcommentsfieldisMandatorymaxLengthminLengthregexValidation
User
(undefined)
username
False
999
5
(undefined)
User
Fromat a valid email
email
False
999
5
^(([^<>()\\[\\]\\\\.,;:\\[email protected]"]+(\\.[^<>()\\[\\]\\\\.,;:\\[email protected]"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$
User
(undefined)
name
False
999
2
(undefined)
User
(undefined)
lastName
False
999
5
(undefined)
User
Format XXXX-XXXX and XXXXX-XXXX
phoneNumber
False
9
8
^(\\d{4,5})-(\\d{4})$
User
(undefined)
location
False
999
0
(undefined)
User
(undefined)
picture
False
999
0
(undefined)
User
(undefined)
gender
False
999
0
(undefined)
User
Format DD-MM-YYYY and DD/MM/YYYY. A date such as 30/30/9999 would be possible.
birthDate
False
10
8
^(0?[1-9]|[12][0-9]|3[01])[\\/\\-](0?[1-9]|1[012])[\\/\\-]\\d{4}$
User
(undefined)
age
False
3
1
(undefined)
User
(undefined)
country
False
50
2
(undefined)
User
(undefined)
city
False
50
2
(undefined)
User
(undefined)
district
False
50
2
(undefined)
User
(undefined)
address
False
999
2
(undefined)
User
Format XXXX-XXX
zipCode
False
9
9
^[0-9]{5}(?:-[0-9]{3})?$
User
Format a valid URL
website
False
999
3
(http|https):\\/\\/(\\w+:{0,1}\\w*)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%!\\-\\/]))?
Gender
(undefined)
code
True
1
1
(undefined)
Gender
(undefined)
gender
False
99
1
(undefined)
NotesNotes

Class MandatoryFields: Detailed Information

The following information about the MandatoryFields class of your application:

MandatoryFields The MandatoryFields class holds the values of Classes/Properties pairs that will be validated using Cloud Code to ensure only the correct data will be stored. It contains the following properties:

  • field (String): the Property name inside a Class that you want to validate
  • class (String): the Class name that you want to validate
  • isMandatory (Boolean): if True, a request must contain the property to be valid. If False, requests without the property will be considered valid as well
  • minLength (Number): the mininum length for a String property to be considered valid
  • maxLength (Number): the maximum length for a String property to be considered valid
  • regexValidation (String): a scaped regular expression that will be run against a String property. If the regex returns true, the property will be considered valid. If false, it will be considered invalid.
  • comments (String): a place for you to comment out details about the validation, specially about the Regex so other users can understand what you did

Here is a quick example of how this class will look like:

  • field: "phoneNumber"
  • class: "User"
  • isMandatory: "true"
  • minLength: "8"
  • maxLength: "10"
  • regexValidation: "^(\d{4,5})-(\d{4})$"
  • comments: "Format XXXX-XXXX and XXXXX-XXXX"