pro-mern-stack
pro-mern-stack copied to clipboard
typo on tryMongo.js file on pgs 104 and 105
The book has multiple periods on the return on two functions in the tryMongo.js file:
book has this:
function testWithPromises() {
let db;
MongoClient.connect('mongodb://localhost/playground').then(connection => {
db = connection;
return db.collection('employees').....insertOne({id: 1, name: 'B. Promises'});
it should be
function testWithPromises() {
let db;
MongoClient.connect('mongodb://localhost/playground').then(connection => {
db = connection;
return db.collection('employees').insertOne({id: 1, name: 'B. Promises'});
Also same mistake in Generator function: book has this:
function testWithGenerator(){
const co = require('co');
co(function*() {
const db = yield MongoClient.connect('mongodb://localhost/playground');
const result = yield db.collection('employees').....insertOne({id: 1, name: 'C. Generator'});
it should be:
function testWithGenerator(){
const co = require('co');
co(function*() {
const db = yield MongoClient.connect('mongodb://localhost/playground');
const result = yield db.collection('employees').insertOne({id: 1, name: 'C. Generator'});
I noticed the same thing and thought about creating an issue, but you beat me to it. :)