Axios Blog Posts

How to reference documents in Mongodb

This article is helpful for those who are seriously looking and finding the usecase of reference documents in MongoDB. Referencing comes when we are saving data to database , that thing we obiously do through axios (Most Popular). Just place the below code inside any router where you want to and check the results.
Saving refs to other documents works the same way you normally save properties, just assign the _id value:
let Team = require('./team.model');
let Player = require('./player.model');
const team = new Team({
_id: new mongoose.Types.ObjectId(),
Name: 'KoderPlace',

0 Likes 28 Views
Full stack with React / MERN Stack Development

This article will be helpful for those who want to try out the complete stack development in javascript. I am using react as frontend, MongoDB as Database, react-router-dom for rest-api calls.
If you have Node and MongoDB installed in your machine just skip the installation part and start building the application.
Installation:
While installing check add path (It will allow you to work with command prompt directly.) options
Node : Download from here
MongoDB: Download from here
Start:

0 Likes 19 Views