Chapter 1 Lab 1

Any way that database can be pushed up to our cluster? Writing queries in the command line is kind of difficult.

If not, I will make do :slight_smile:

You can do it with Compass. You simply connect to the class cluster and play with the aggregations database.

What exactly do I post in Compass to get access to this database?

Would it be possible to get a URI?

Please check this link
Try what is given in your course before trying this

How to connect with Compass

Hi Riza,

I’m writing to you because I found writing queries in the command line kind of difficult, too. I have another recommendation to make when it comes to MongoDB tooling. Do you use the Microsoft Visual Studio Code Editor, at least sometimes? There’s a MongoDB plugin for VSCode, which I found helpful.

They have (at least some) auto-completion, syntax-highlighting, and a feature they call Playgrounds. It is a Javascript Editor with some MongoDB enhancements, you write like Javascript, and hit a |> button (“play”) and your ingredients of that Playground is submitted to your MongoDB server, be it local or be it Atlas. Maybe it helps.

Regards, and a happy new year! M.

1 Like

I was actually was not familiar with the VSCode plugin. That is something I will checkout.

My work around for this was kinda of… aggresive? I created an API using NodeJS and used the provided URI as my connection string.

Ended up working really well. I was able to write my queries directly in my code editor and simply had to send a GET request via Postman to see the results.

Either way, thanks for confirming that I am not the only one that finds commandline mongodb queries to be very difficult to read/write :).

HI Riza,

thank you for your swift reply.

Maybe you wrote your MongoDB queries in your editor of choice and then copy-pasting them into Postman? That would be a suitable workaround, for sure.

By the way, I want to learn Postman, too, have it already installed on my machine. Is it difficult to find a suitable getting-started tutorial on Postman that doesn’t go overboard showing too much features - just enough to get by with MongoDB queries? Do you have any recommendation(s).

And, do I need a Postman account to get started, i.e., would you recommend getting an account?

Thanks in advance,

Regards, M.

I actually wrote the queries in my Model files located in this repo:

I have only ever used Postman with some basic GET/POST requests. Its quite self explanatory and you should be up and running in an hour of Youtube tutorials or blogs.

HI Riza,

thank you very much. Will check out soon.

Regards, M.

Hi all,

We are working on revamping the current version of the MongoDB Aggregation Framework Course.

In the updated course, we will be using the MongoDB Atlas along with the Mongo Shell for easy visualization and query formation.

For the current version of the course, we recommend using a text editor of your choice to build aggregation pipelines and then copy-pasting it to the mongo shell or you can use Compass.

Please feel free to reach out if you have any additional questions.

Kind Regards,

1 Like