Skip to content

Commit e50b162

Browse files
committed
More querying data.
1 parent ce95f7f commit e50b162

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

README.md

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Infinity
5757
We can also declare functions that we can reuse, below is [Fizz Buzz](https://en.wikipedia.org/wiki/Fizz_buzz)
5858
5959
```javascript
60-
> var fizzBuzz = input => {
60+
> const fizzBuzz = input => {
6161
if (input % 15 === 0) return 'FizzBuzz';
6262
if (input % 3 === 0) return 'Fizz';
6363
if (input % 5 === 0) return 'Buzz';
@@ -284,3 +284,31 @@ Let's change the colour of our vehicle with the `_id` of `ObjectId("5d17d5ef55fa
284284
"colour" : "orange"
285285
}
286286
```
287+
288+
Perfect, now we've got an orange car!
289+
290+
Feel free to make up some of your own updates to the documents.
291+
292+
293+
## Querying parkrun Data
294+
295+
### Connect to the database
296+
297+
We'll need to drop out the current shell and create a new session to a database hosted in [MongoDB Atlas](https://www.mongodb.com/cloud/atlas). Atlas is a SaaS offering of MongoDB provided by MongoDB.
298+
299+
To connect to the database run the following command but replace the `<username>` and `<password>` with the given details.
300+
301+
```bash
302+
mongo "mongodb+srv://cluster0-dxyc7.mongodb.net/parkrun-map" --username <username> --password <password>
303+
```
304+
305+
Once connected run the following to see the structure of the parkrun data:
306+
307+
```javascript
308+
> db.parkruns.findOne();
309+
```
310+
311+
Now use the data inside mongodb with the knowledge you've got so far to query the parkrun dataset to find answers to the following questions.
312+
313+
### Questions
314+

0 commit comments

Comments
 (0)