You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I installed mongodb via homebrew and I was able to follow the shell examples to work with mongo.
Then in the section 'Reading from MongoDB' I get an error in the server saying: 'TypeError
TypeError: db.collection is not a function'. Anyone know how to fix this?
I even tried changing the line to:
db.collection('issues').find().toArray()
but then it says cannot use find() of undefined.
I checked to see if the database and collection is there and they exist, but just seem to not get the data programmatically.
The text was updated successfully, but these errors were encountered:
Figured out why.... Apparently if you just run 'npm install mongodb --save' based on what page 101 says you will get the latest version which is 3.0 as of this comment. Version 3 has different ways of getting the database connection. To avoid errors it's best to look at this repository's package.json and use the version that it installs instead of the latest versions.
I installed mongodb via homebrew and I was able to follow the shell examples to work with mongo.
Then in the section 'Reading from MongoDB' I get an error in the server saying: 'TypeError
TypeError: db.collection is not a function'. Anyone know how to fix this?
I even tried changing the line to:
db.collection('issues').find().toArray()
but then it says cannot use find() of undefined.
I checked to see if the database and collection is there and they exist, but just seem to not get the data programmatically.
The text was updated successfully, but these errors were encountered: