Using system.profile with mongoose

Solution for Using system.profile with mongoose
is Given Below:

I am trying to figure out how to use this command db.system.profile.find().limit(10).sort( { ts : -1 } ).pretty(); with mongoose in node js. This command works fine in mongodb shell

I did this already:

try {
  // Connect to the MongoDB cluster
  mongoose.connect(
    mongoAtlasUri,
    { useNewUrlParser: true, useUnifiedTopology: true },
    () => console.log(" Mongoose is connected")
  );
} catch (e) {
  console.log("could not connect");
}

const dbConnection = mongoose.connection;

dbConnection.on("error", (err) => console.log(`Connection error ${err}`));