Lab 1.1: Install Course Tools and Datasets - mongod port 27017

In this part of the Lab:
Assuming you are running mongod on port 27017 , your mongodb URI is:

I dont know how to resolve this part of the lab
I thought that was using: mongod --port 27017 but isnt it.

I need some help to do mongoimport in my mongodb://localhost:27017 port.

Thank you

What issue you are facing with mongoimport on localhost?

You don’t need URI for local.Just run mongoimport with other parameters
Is your local mongod up and running on port 27017?

Hi @Veronica_Moreno_Flor

Just to confirm there are two options in that lab session and you only need to do one. If you have already imported the data into an Atlas cluster then you are finished as you only need to be one or the other options.

If you are running MongoDB on your machine, can you confirm that you followed the instruction on this docs page for your operating system? This will run a single mongod instance on port 27017 on your local machine.

Can you let us know which of the two types of deployment you are using for the course (Atlas or locally installed MongoDB)? Can you also confirm if it is locally installed that you have followed the instructions for your operating system for your machine?

Kindest regards,
Eoin

I have this situation right now.
Result is equal to 0. ¡impossible!

Thank you!

Hi @Veronica_Moreno_Flor

It looks like there might be a mismatch between what your Compass app is connected to and what your command line/terminal is connected to. Are you running multiple mongod instances on your machine?

Can you confirm that both windows are connected to the same mongod on the same machine on the same port?

Kindest regards,
Eoin

I thought I had to open in a console: mongod --port 27017
and then in another my mongo and execute

use m201
db.people.count({ “email” : {"$exists": 1} })

I dont know how to do that then :slight_smile:

Hi @Veronica_Moreno_Flor

Running a single mongod instance on port 27017 and separately in another window connecting to that mongod and executing those commands are the exercise. You are correct. The screenshots you posted previously indicate that the connection is possible to another mongod running on your machine or remotely as you have successfully imported the m201 people collections to a running mongod.

I’d suggest shutting down all running mongod instances on your machine and trying to connect again if you wish to use the terminal, alternative you can continue and simply use Compass as it appears connected to a database and collection with the information required.

Kindest regards,
Eoin

It is possible to get zero (gave an example at bottom)
Does your collection exist
If yes does it have records
Mongodb does not throw any error when you switch to non existent DB or query a non existing collection

On your local mongodb instance i see most of your DB are of 0 GB size.Either collection are empty or minimal records exist

You can check
use m201
show collections
if products exist
db.products.find().count()

example:

use video
switched to db video
show collections
movieDetails
db.products.find().count()
0