M121 chapter 4 'companies' collection not found

Hi:
The ‘companies’ collection used in chapter 4 M121 is not amongst the collection provided for the course. db is aggregations, show collections doesn’t display ‘companies’ in the list of collections available. It is not in Compass any longer - it was there throughout M001.
Thanks,
Rhonda

You are right.

But the collections they used in the videos are not the one you need for labs and quizzes. The collections used in the videos are there to explain concepts and capabilities.

Yeah, but my learning process starts by examining the examples used in the lectures; hence, I missed out a lot by making companies collection unavailable. In fact, the only $facet aggregation in the lecture doesn’t even show the output:

db.companies.aggregate( [
    {"$match": { "$text": {"$search": "Databases"} } },
    {"$facet": { 
      "Categories": [
	{"$sortByCount": "$category_code"}],
      "Employees": [
        {"$match": {"founded_year": {"$gt": 1980}}},
        {"$bucket": {
          "groupBy": "$number_of_employees",
          "boundaries": [ 0, 20, 50, 100, 500, 1000, Infinity  ],
          "default": "Other" }}],
      "Founded": [
        {"$match": {"offices.city": "New York" }},
        {"$bucketAuto": {
          "groupBy": "$founded_year",
          "buckets": 5  }}] }}]).pretty()

I hope there’re no more lectures that don’t share the used collection.
Thanks.

1 Like

If you have access to your M0 cluster you can run the queries there or import companies.json to your local mongodb

Chapter 4: Facets: Single Facet Query Lecture

1 Like

I am not sure where/how to check whether I have access to M0. It’d be really helpful to be able to import datasets (collections) to my local mongodb.

When you did M001 course you would have created your Sandbox cluster
Login to your Atlas account.You can see your cluster

Did you find the comapnies.json from handouts?
Download it and import to your local mongod instance

Got it.
Thank you so much.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.