Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The example below creates the car model with the specified schema. The car models will be stored in Mobile Backend Services as CustomObjects. Since the autogen property was not set to false, API Builder automatically generates the pre-defined endpoints for the client to access the car models using the <SEVER_ADDRESS>/api/car endpoints.

Code Block
languagejs
var Arrow = require('arrow');

var car = Arrow.createModel('car', {
    fields: {
        make:{type:String, description:'the make of a car '},
        model:{type:String, description:'the model of the car', required:true},
        year: {type:Number, description:'year the car was made', required:true},
        bluebook: {type:Number, description:'kelly bluebook value of the car', required:true},
        mileage: {type:Number, description:'current mileage of the car', required:true}
    },
    connector: 'appc.arrowdb'
});

module.exports = car;