I wanted to check if my MongoDB server is running.
I am following a tutorial in thinkster.io about the MEAN stack tutorial.
Our first step in making a persistent data store is to configure our data models. To do this, we are going to be adding a schema layer on top of MongoDB using a nice library called Mongoose. Before we begin, let's make sure our MongoDB server is running.
I tried many things but I didn't know what to do. My main question is whether you have to start the server and then open another cmd and type
mongod &
or
stop the server and then type
mongod &
or
when the server is running just type
mongod &
in the same cmd without stopping the server or starting another cmd.
let me describe you in a clear way when you type mongod
in cmd it will start your mongod server
it means your database service is started
now for connecting to mongo you should open new cmd
and type mongo
it will behave as a client.now you can query in mongo like this
show collections
show dbs