Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to accurately reflect new Mongo Docs #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions exercises/find/problem.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Here we will learn how to search for documents.

In this exercise the database name is `learnyoumongo`.
So, the url would be something like: `mongodb://localhost:27017/learnyoumongo`
The URL would be something like: `mongodb://localhost:27017/`.

Use the `parrots` collection to find all documents where `age`
is greater than the first argument passed to your script.
Expand All @@ -15,8 +15,10 @@ To connect to the database, one can use something like this:

```js
var mongo = require('mongodb').MongoClient
mongo.connect(url, function(err, db) {
// db gives access to the database
mongo.connect(url, function(err, dbClient) {

var db = dbClient.db(database_name);
// db gives you access to the DB.
})
```

Expand All @@ -39,7 +41,7 @@ collection.find({
```

If your program does not finish executing, you may have forgotten to
close the `db`. That can be done by calling `db.close()` after you
close the `db`. That can be done by calling `dbClient.close()` after you
have finished.

## Resources:
Expand Down