poopcode
MongoError: pool is draining, new operations prohibited – How to fix?
MongoError: pool is draining, new operations prohibited – How to fix? You might face this error while doing some operations on a Mongo database. mongoose.connect(url, {bufferMaxEntries: 0, reconnectTries: 5000, useNewUrlParser: true,useUnifiedTopology: true}); This error basically means that the connection that you established with the mongodb has already expired. To elaborate, you haven’t used connection pool with your … Read more
Top K Frequent Words – Leetcode Challenge – Python Solution
This is the python solution for the Leetcode problem – Top K Frequent Words – Leetcode Challenge – Python Solution. Source – qiyuangong’s repository.
TypeScript code snippet – How check is file exist linux
FILE=/etc/resolv.conf if [ -f “$FILE” ]; then echo “$FILE exists.” else echo “$FILE does not exist.” fi
Add JWT Authentication to your Swagger API docs
In this tutorial let’s discuss how to add authentication to your Swagger APIs, specifically JWT. Your APIs should be authenticated with some authentication schemes to secure them from online attacks. Advertisements Once you implement Swagger UI for your RESTful APIs, the next step is add authentication. Swagger supports the following authentication schemes. In this tutorial, … Read more
Arrays – DS – Hackerrank Challenge – Java Solution
This is the Java solution for the Hackerrank problem – Arrays – DS – Hackerrank Challenge – Java Solution. Source – Java-aid’s repository.
Pass arguments to your node.js app from pm2
In this post you will learn how to pass arguments to your node.js when you use pm2 to run your node.js application. You can pass arguments to your node.js app using either of the following commands. node index.js dev npm start dev Here I send the value ‘dev’ to the node.js app which can be received using the following … Read more