text: //copied cat.js and adjusted for new params
  
  const mongoose = require('mongoose');
  
  mongoose.Promise = global.Promise;
  
  let DogModel = {};
  
  const DogSchema = new mongoose.Schema({
    name: {
      type: String,
      required: true,
      trim: true,
      unique: true,
    },
  
    breed: {
      type: String,
      required: true,
      trim: true,
      unique: true,
    },
  
    age: {
      type: Number,
      min: 0,
      required: true,
    },
  
    createdData: {
      type: Date,
      default: Date.now,
    },
  
  });
  
  DogSchema.statics.sayName = (dog) => {
    console.log(dog.name);
  };
  
  DogSchema.statics.findByName = (name, callback) => {
    const search = {
      name,
    };
  
    return DogModel.findOne(search, callback);
  };
  
  DogModel = mongoose.model('Dog', DogSchema);
  
  
  // exports
  module.exports.DogModel = DogModel;
  module.exports.DogSchema = DogSchema;
  