// Import the necessary modules
const Parse = require('parse').Parse;
const Promises = require('parse-promises');
// Create a new Parse object
const parse = new Parse();
// Define the Car class with the necessary fields
class Car {
constructor(brand, model, mileage, color, fabricationDate) {
this.brand = brand;
this.model = model;
this.mileage = mileage;
this.color = color;
this.fabricationDate = fabricationDate;
}
}
// Create 10 sample cars and save them to the Parse database
Promises.all([
// Sample car 1
parse.object('Car')
.set({
brand: 'Toyota',
model: 'Camry',
mileage: 20000,
color:'silver',
fabricationDate: '2021-01-01'
})
.save()
// Sample car 2
, parse.object('Car')
.set({
brand: 'Honda',
model: 'Accord',
mileage: 15000,
color: 'blue',
fabricationDate: '2020-12-15'
})
.save()
// Sample car 3
, parse.object('Car')
.set({
brand: 'Ford',
model: 'Mustang',
mileage: 10000,
color:'red',
fabricationDate: '2022-02-28'
})
.save()
// Sample car 4
, parse.object('Car')
.set({
brand: 'Chevrolet',
model: 'Corvette',
mileage: 8000,
color: 'black',
fabricationDate: '2021-06-10'
})
.save()
// Sample car 5
, parse.object('Car')
.set({