Category: Mongodb

  • Creating REST APIs using Node, Express, Typescript, Mongodb

    In the last tutorial, we were able to setup our client using React. In this part, we gonna be focusing on the backend/server building the API’s for our Todo App. Setting up Mongodb Let’s install lerna add ‘mongoose’ –scope ‘@fullstackopenjs/server’ lerna add -D ‘@types/mongoose’ –scope ‘@fullstackopenjs/server’ This will install the dependencies In order to use […]

  • Using $pull in Mongodb aggregation pipelines

    Removing a value from existing array using $pull Suppose we have the following documents in the users collection: Now, if I want to delete swimming from the document where the user_name is “sujaykundu” we can do is : Now, the result will be: ### Remove Items from an Array of embedded documents Now suppose we […]

  • MongoDump, MongoRestore and MongoImport in MongoDB

    If you use mongodb, you might have the challenge of taking data dump or importing the data dump back to the db. This article is for you. I am currently using Windows OS. For other OS like Mac OS and Linux, the process is almost similar. MongoRestore The mongorestore program loads data from either a binary database […]