Functions Without Context

Functions Without Context

When Inbuilt functions are called on expression with dot the expression is passed as the first argument. below is the syntax for each function with context

  • - now: now(<Expression as Date Format>) Example: now("%d %m %y")
  • - add: add(<Expressions as Numbers separated by comma>) Example: add(4,5,6)
  • - captcha: captcha(<Expression as Captch String>) Example: captcha("Abcd")
  • - mod: mod(<Expression as First Number>,<Expression as Second Number>) Example: mod(3,4)
  • - ceil: ceil(<Expression as Number to ceil>) Example: ceil(3.5)
  • - floor: floor(<Expression as Number to floor>) Example: floor(3.5)
  • - round: round(<Expression as Number to round>,<Expression as Number of Decimal Places>) Example: round(3.3456,3)
  • - cint: cint(<Expression as Number to convert to Integer>) Example: cint(3.5)
  • - sub: sub(<Expression as First Number>,<Expression as Second Number>) Example: sub(3,4)
  • - mul: mul(<Expressions as Numbers separated by comma>) Example: mul(4,5,6)
  • - div: div(<Expression as First Number>,<Expression as Second Number>) Example: div(4,2)
  • - concat: concat(<Expressions as Strings separated by comma>) Example: concat("Hello ","World ","There")
  • - lpad: lpad(<Expression as String to be padded>,<Expression as String to pad>,<Expression as Final Length>) Example: lpad(3,"0",5)
  • - rpad: rpad(<Expression as String to be padded>,,<Expression as String to pad>,<Expression as Final Length>) Example: rpad(3,"0",5)
  • - mid: mid(<Expression as String to be taken from>,<Expression as From Index>,<Expression as Length>) Example: mid("Atmaram",2,3)
  • - left: left(<Expression as String to be taken from>) Example: left("Atmaram",3)
  • - right: right(<Expression as String to be taken from>,<Expression as Length>) Example: right("Atmaram",3)
  • - from_json: from_json(<Expression as Path of file>) Example: from_jason("/usr/local/objects.json")
  • - fake: fake(<Expression as Type of Fake Field>) Example: fake("FirstName"), Following Fake Field Types Supported
    • - "Name"
    • - "FirstName"
    • - "LastName"
    • - "Title"
    • - "Suffix"
    • - "NameWithTitle"
    • - "CompanySuffix"
    • - "CompanyName"
    • - "Profession"
    • - "CityName"
    • - "StreetName"
    • - "StateName"
    • - "StateAbbr"
    • - "ZipCode"
  • - encode: encode(<Expression as String to be encoded>) Example: encode("Atmaram")
  • - random: random(<Expression as Numeric Lower Bound>,<Expression as Numeric Upper Bound>) Example: random(100,300)
  • - array: array(<Expression as Numeric Length of Array>,<Expression to be evaluated while populating each element>) Example: array(4,"FirstName".fake())
  • - unique_random_elements: unique_random_elements(<Expression as Numeric Length of Array>,<Expression as Array from where elements to take>) Example: unique_random_elements(2,object [1,2,3,4,5,6,7,8,9])
  • - contains: concat(<Expression as String to be checked>,<Expression as String to check>) Example: contains("Atmaram ","ara")
  • - random_element: random_element(<Expression as Array from where element to take>) Example: random_element(object [1,2,3,4,5,6,7,8,9])