From the course: MongoDB Essential Training

Unlock the full course today

Join today to access over 24,100 courses taught by industry experts.

Solution: Indexes

Solution: Indexes

(cheerful music) - [Instructor] All right. So the database is supposed to be called, Lookup. So the first thing I'm going to do is say, use lookup. Then to create the database, the collection and a document, what I'm going to do is, I'm going to insert a document. So I'm going to say, db.records for the collection name, and then I'll use the insertOne method, and I will insert one document. This is supposed to contain records for businesses. So, the first thing I'm going do is, I'm going add a field with a name for the business, and I'm going to call this Naomi's business, and then I'm going add a number. So that will be the phone number by which we can look up. So, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Okay, then we'll have some additional fields. I'm going to add a field for our website, and I will just add my own personal website in here. Okay, cool. So that adds a record you could add multiple, but I think for this…

Contents