Skip to content

Instantly share code, notes, and snippets.

@ashutosh887
Last active January 21, 2023 04:03
Show Gist options
  • Save ashutosh887/298a12add8c3cfbc853c2a82e760ff31 to your computer and use it in GitHub Desktop.
Save ashutosh887/298a12add8c3cfbc853c2a82e760ff31 to your computer and use it in GitHub Desktop.
1. DeprecationWarning: Mongoose: the `strictQuery` option will be switched back to `false` by default in Mongoose 7
mongoose.set("strictQuery", false);
mongoose
.connect(process.env.MONGO_URL, {
useUnifiedTopology: true,
useNewUrlParser: true,
})
.then(() => {
console.log(`MongoDB Server connected successfully...`);
})
.catch((error) => {
console.log(`Error connecting to MongoDB: ${error}`);
});
_________________________________________________
2. Error connecting to MongoDB: MongooseServerSelectionError: connect ECONNREFUSED ::1:27017
If you are using latest nodejs (v17.x) , then try updating mongodb url from localhost to 127.0.0.1
This worked for me 🥳
_________________________________________________
3. How do I change the URI (URL) for a remote Git repository?
git remote set-url origin new.git.url/here
To remove remote use this:
git remote remove origin
_________________________________________________
4. Pull remote Branch to local:
git fetch origin
git checkout <branch-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment