text: const mongoose = require('mongoose');
  
  mongoose.Promise = global.Promise;
  
  // variable to hold our Model
  // A Model is our data structure to handle data. This can be an object, JSON, XML or anything else.
  // A mongoDB model is a Mongo database structure with the API attached
  // That is, a model has built-in functions for its data structure like find, findOne, etc.
  // Usually you will retrieve data from the database through the Model object
  let DogModel = {};
  
  
  const DogSchema = new mongoose.Schema({
    name: {
      type: String,
      required: true,
      trim: true,
      unique: true,
    },
    breed: {
      type: String,
      required: true,
      trim: true,
    },
    age: {
      type: Number,
      min: 0,
      required: true,
    },
    createdDate: {
      type: Date,
      default: Date.now,
    },
  });
  
  DogSchema.statics.sayName = (dog) => {
    console.log(dog.name);
  };
  
  // static function to find dog name
  DogSchema.statics.findByName2 = (name, callback) => {
    const search = {
      name,
    };
  
    return DogModel.findOne(search, callback);
  };
  
  DogModel = mongoose.model('Dog', DogSchema);
  
  // export our public properties
  module.exports.DogModel = DogModel;
  module.exports.DogSchema = DogSchema;
  