English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

NodeJS Basic Tutorial

NodeJS Express.js

NodeJS Buffer & URL;

NodeJS MySql

NodeJS MongoDB

NodeJS File (FS)

NodeJS Other

Node.js MongoDB

Node.js MongoDB  In this Node.js tutorial, we will learn how to integrate MongoDB into a Node.js application.

Prerequisites for using MongoDB from Node.js

  1. Ensure MongoDB is installed. If not, please install MongoDB.

  2. Install the mongodb package using npm (if not already installed).

    arjun@nodejs:~/workspace/nodejs/mongodb$ npm install mongodb
    npm WARN saveError ENOENT: no such file or directory, open'/home/arjun/workspace/nodejs/package.json'
    npm WARN enoent ENOENT: no such file or directory, open'/home/arjun/workspace/nodejs/package.json'
    npm WARN nodejs No description
    npm WARN nodejs No repository field. 
    npm WARN nodejs No README data
    npm WARN nodejs No license field. 
     
    + [email protected]
    added 9 packages in 9.416s

Node.js MongoDB Tutorial Index

When learning to connect with MongoDB, in subsequent tutorials, we will learn the following concepts:

  • Connect to MongoDB in Node.js

  • Create Database in MongoDB in Node.js

  • Delete Database from MongoDB in Node.js

  • Create Collection in MongoDB Database in Node.js

  • Delete Collection from MongoDB Database in Node.js

  • Insert Document(s) into MongoDB Collection in Node.js

  • Query Document(s) in MongoDB Collection in Node.js

  • Update Document(s) in MongoDB Collection in Node.js

  • Delete Document(s) from MongoDB Collection in Node.js

References

MongoDB Tutorial – Learn the Basics of MongoDB through Examples.

Conclusion:

In this Node.js tutorial – Node.js MongoDB, we learned how to interface MongoDB database with Node.js application through examples.