title: MongooseError: Operation users.insertOne() buffering timed out after 10000ms” in Mongo Db atlas
body: <p>I am currently working with node and mongoDB
  here is my code</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import dotenv from "dotenv";
  import mongoose from "mongoose";
  
  dotenv.config();
  
  mongoose
    .connect(
      `mongodb+srv://OmniBotBuilder:${process.env.DBPASS}${process.env.DBUSER}.kx2vg.mongodb.net/${process.env.DBNAME}?retryWrites=true&amp;w=majority`,
      {
        useUnifiedTopology: true,
        useNewUrlParser: true,
      }
    )
    .catch(() =&gt; console.error("Unable to connect to DB"));
  
  mongoose.connection.on("connected", () =&gt; {});
  
  const Schema = mongoose.Schema;
  
  const omniGamesSchema = new Schema({
    discordId: Number,
    steamId: Number,
  });
  
  const omniGamesModel = mongoose.model("omniGamesSchema", omniGamesSchema);
  
  const createNewUser = (discordId, steamId) =&gt; {
    const newUserMap = new omniGamesModel({
      discordId: discordId,
      steamId: steamId,
    });
  
    newUserMap.save((err) =&gt; {
      if (err) {
        console.error(err);
      }
    });
  };
  
  export { createNewUser };</code></pre>
  </div>
  </div>
  </p>
  <p>and the error i am getting is this one <a href="https://i.stack.imgur.com/YT3Mt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YT3Mt.png" alt="enter image description here" /></a></p>
  <p>MongooseError: Operation <code>omnigamesschemas.insertOne()</code> buffering timed out after 10000ms
  at Timeout. (C:\Users\dahiy\OneDrive\Desktop\bots\omni-games\node_modules\mongoose\lib\drivers\node-mongodb-native\collection.js:198:23)
  at listOnTimeout (node:internal/timers:557:17)
  at processTimers (node:internal/timers:500:7)</p>