Access to the companies database

Hi, @DHz
I tried to change to the companies database, using use startups and I couldn’t, since it probably doesn’t exist.
Could you point how it can be accessed/used?

Thanks.

@ Apurva_Kunkulol

You need to give me more information here – I’ve got more than one course, and more than one student. I’ll be happy to help, but if you ask a question like this, please indicate the Lecture title. Thanks.

It’s from the Mongo121: The MongoDB Aggregation Framework: Chapter 4: Lecture 3: The $bucket stage.

Thanks.

@ Apurva_Kunkulol

I just went through that Lecture. There is no mention of a companies database or a startups database – your question is a bit confused on that point, since use would point to the database; the examples all use aggregation.movies.

@DHz

I have the same problem with startups db. I’m at Chapter 4: Core Aggregation - Multidimensional Grouping and the lecture is * Facets: Single Facet Query* . Here https://youtu.be/NMyDE4oWwpg?t=81 the instructor show that use companies collection on startups db for their examples.

In my console I tried to do the same commands but I receive an error

MongoDB Enterprise Cluster0-shard-0:PRIMARY> use startups
switched to db startups
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show collections
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db
startups
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show collections
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db.companies.find()
Error: error: {
        "operationTime" : Timestamp(1619045210, 1),
        "ok" : 0,
        "errmsg" : "not authorized on startups to execute command { find: \"companies\", filter: {}, lsid: { id: UUID(\"1c7cfeaa-f3b5-45a0-8361-1233f8d3ff39\") }, $clusterTime: { clusterTime: Timestamp(1619045200, 1), signature: { hash: BinData(0, D7C162A7051C18B38DEE58E092910476A07EEFFC), keyId: 6902062171803353090 } }, $db: \"startups\" }",
        "code" : 13,
        "codeName" : "Unauthorized",
        "$clusterTime" : {
                "clusterTime" : Timestamp(1619045210, 1),
                "signature" : {
                        "hash" : BinData(0,"Omr6asKXM/hdG5AmD+VyaCMzQYM="),
                        "keyId" : NumberLong("6902062171803353090")
                }
        }
}

Hey @Dennis_A_Boanini,

You can use the following link to download the Companies dataset :
companies_dataset/companies.json

Then you can use mongoimport command to load the dataset into your mongod instance.

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

Kind Regards,
Sonali Mamgain

1 Like