Skip to main content

Posts

Showing posts from October, 2020

Is the _id Property in MongoDB 100% Unique?

  MongoDB   is a NoSQL database that operates with collections and documents. Each document created on MongoDB has a unique object ID property. So when creating a document without entering an ID, the document will be created with an auto-generated ID. Who Generates the ID? When filling in the properties of a document, we do not necessarily need to enter the object ID. But when we refer to MongoDB after creating a document, it would have an object ID that looks like this: { “_id”: “5f1819229fdf8a0c7c2d8c36” } This makes it much easier for us when creating documents in MongoDB and saves us a lot of time. The object ID in the documents in MongoDB is created by the MongoDB driver, which talks to MongoDB. Therefore, this brings out a lot of advantages: You do not need to wait for MongoDB to create a new unique identifier. Applications of MongoDB are highly scalable. You can create several instances of MongoDB. There is no need to talk to a central place to get a unique identifier. Proper

Implement Auth0 With Your Node.js App

  What Is Auth0? Auth0 is a third-party tool that provide services for authentication and authorization. It provides the building blocks for authentication and authorization, allowing you to secure your applications without having to become security experts. You can integrate Auth0 into any Node.js app. To implement Auth0 with Node.js, first you need to  create an account  on Auth0. Then,  log in . Step 1: Get the Auth0 Application Keys Now we need to do some configuration on Auth0, so let’s do it. When you signed up for Auth0, a new application was created for you — or you could have created a new one. We need the following information: Domain key Client ID key Client-secret key Snapshot: Auth0 dashboard Now get the application keys and save them somewhere: Go to the Applications > Defaut App > Settings. Snapshot: Copy the keys Copy the Domain, Client ID, and Client Secret. They’ll be used in our Node app. Step 2: Configure the Callback URL in Your Auth0 App A  callback URL  is