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

Find exercise: connect callback parameters have changed in current version #69

Open
VAggrippino opened this issue Mar 17, 2018 · 8 comments

Comments

@VAggrippino
Copy link

In the current version of the Node.js MongoDB Driver, the second argument to the MongoClient.connect() callback has changed from a database object to the MongoClient instance.

There are a few changes that should be made to the hint section in order to make it consistent with the current API.

It should also be noted that the close() method is now called on the client instance rather than the database object.

The resources should probably also reference the current API documentation for the Collection's find method: http://mongodb.github.io/node-mongodb-native/3.0/api/Collection.html#find

Reference:

@i0na-k
Copy link

i0na-k commented Mar 20, 2018

In order to continue using the db object we have to npm uninstall mongodb and then npm i mongodb@2.2.33

@VAggrippino VAggrippino changed the title Find exercise: connect callback parameters have changed in current versoin Find exercise: connect callback parameters have changed in current version Mar 20, 2018
@VAggrippino
Copy link
Author

Why would we want to stick with an old version of MongoDB instead of updating the course material? It's a bad idea to teach people things that won't work with the current version of MongoDB. Besides that, I'm talking about a relatively small change to a single block of text, not an overhaul of the course.

@i0na-k
Copy link

i0na-k commented Mar 20, 2018

Because learnyoumongo is all about teaching the concepts of node which may be easier to do with more stable versions. Its just a suggestion

@VAggrippino
Copy link
Author

@ionakathryn What are you talking about? This is learnyoumongo, not learnyounode.

NPM packages, like mongodb which implemented this change, follow a semantic versioning convention. Stable doesn't mean anything here. The change was made in a major release. However, it is stable in the literal sense of the word... It's not going to be reverted and there are not going to be any breaking API changes until the next major release.

The concepts of mongo that we're trying to teach and learn here are how to connect to a database and perform CRUD operations on it. That will only be harder to do with instructions and example code that don't work.

Requiring installation of an older version of a driver without documenting it or explaining why is going to leave people without the ability to perform these basic tasks in this tutorial or a real development environment.

@i0na-k
Copy link

i0na-k commented Mar 21, 2018

That was a typo. Yeah there are some issues in learnyoumongo, for example console.log doesn't seem to work for a few of the exercises. To be honest I have been running mongodb@2.2.33 and encountered no issues other than console.log not working, however think this is by design and believe it has nothing to do with versioning. Please let me know if this is not the case.

The exercises do not require the installation of a previous version and I have not said this. I mentioned that a workaround would be to install mongodb@2.2.33. I didn't advise users to do this, I simply mentioned it as a workaround.

Requiring installation of an older version of a driver without documenting it or explaining why is going to leave people without the ability to perform these basic tasks in this tutorial or a real development environment.

As mentioned above, I have been able to perform all these tasks with mogodb@2.2.33 with no problems regarding versioning.

@Candle309
Copy link

@ionakathryn Maybe you are right and I really appreciate all your efforts to build this tutorial. However, I'm not pro like you. I'm just new to all this database thing. When I sucked up and even the solution cant help me I felt very upset. I even wanted to give up until I found this guy @VAggrippino 's helpful information and reference. Maybe changing couple lines of code is really easy for you which may not take you more than 5 mins. But it's really a big mess for me to learn something that doesn't work. Thanks to @VAggrippino again! And I'll appreciate if you do some change on the solution to help people like me :).

@wju-MSFT
Copy link

wju-MSFT commented Apr 7, 2018

I bet it will not take you senior programmers more than 10 min to change the hint in accordance to the current mongodb version change. But it took a entire Friday night for us noob programmers to find a solution to it and it has nothing to do with coding skill at all. Thanks @VAggrippino for pointing it out (thumbed up). Now we just have to struggle in between the newer version API and the older version instructions. Good luck to those who are trying to learn the "concepts" from those out-of-date hints.

@VAggrippino
Copy link
Author

Unfortunately, the last commit to this repository was almost a year ago. I don't think anyone with the ability to make a change is paying attention any more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants