bwdbooks / nodejs-mongodb-angularjs-web-development Goto Github PK
View Code? Open in Web Editor NEWFor the Node.js, MongoDB and AngularJS Web Development Book
For the Node.js, MongoDB and AngularJS Web Development Book
The code to update a doc using the save() fails with a validation error. It turns out that the 'book' word used in the example fails to satisfy the schema particularly with its 'charsets' property which in the database is an empty array.
to make the example work either one of two options can be used:
Thanks for a very informative book.
Line 5 in mongoose_connect.js should read:
mongoose.connection.db.listCollections().toArray(function(err, names){
as collectionNames is now deprecated.
When I try to run the code I get this error:
node auth_server.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at Server.listen (net.js:1135:5)
at Function.app.listen (/home/ubuntu/htdocs/joolip/node_modules/express/lib/application.js:532:24)
at Object. (/home/ubuntu/htdocs/joolip/auth_server.js:27:5)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
I believe there is something wrong with the code, as I am receiving an error code of 'fd must be a file descriptor'.
Can you please advise? Thanks
I am new nodejs/mongodb I see the code but I want to know how to execute shopping cart app. there are other files missing like package.json or may be other files. can you help to set it up?
Hi Brad,
I really liked your book "Node.js, MongoDb, Angularjs Web Development". Only issue I had with your GitHub files is that bodyParser has been depreciated and the new info isn't in your samples. I think this happened about the time you published the book.
I changed samples as needed to be:
app.use(bodyParser.urlencoded({ extended: true }));
app.use(cookieParser());
Also express-session seems to need resave and saveUninitialized to be set to true/false (no longer defaults)
After the above changes ALL your samples ran great! (and that's a big deal). Your book is one that I will keep close at hand. Thanks much!
I would offer the changes as a pull request but I have mangled your samples trying out various "what happens if I do this" experiments.
Cheers
Charlie
I have mongodb installed and trying to run chapter26 with command: node auth_server.js and I get error: Failed to load c++ bson extension, using pure JS version. I tried various option to upgrade/downgrade mongodb but could not get around the issue. Is it possible to include package.json in chapter26 first and later to other so I could run npm install and get all the correct version of required package.
Regards,
Praveen
On chapter 8 after running
node socket_client.js
I get the error
events.js:72
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED
at errnoException (net.js:904:11)
at Object.afterConnect [as oncomplete] (net.js:895:19)
Use Chrome Developer tools, the following issue was found:
GET http://localhost:3000/images/ 404 (not found)
I believe that line 57: res.redirect(/'login');
would cause an error since you already redirect in line 55, during an authentication failure. When I run the sample, the app crashes out when you enter an invalid password. Removing line 57 fixed it.
The error: Error('Can't set headers after they are sent.')
Ch15 : doc_paging.js
I thought that placing the pagination within a recursive call would be a good idea as well but the recursion occurs quicker than mongodb can query the database. So on my machine the database is closed before each 'page' is printed.
What would be a good workaround for this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.