>If your package.json already consists a “test” object with some different value, replace it with the code given above. Once done, your scripts object might look like this.
With this particular `react-scripts` example, it doesn’t sound right. If you use Create React App **it already includes Jest**. There is no need to add it once again explicitly. You would just make it incompatible with Create React App future updates. Could you please clarify that this guide is not for Create React App users?
Awesome, thank you! I’m rewriting my voice interface app in a NodeJS + MongoDB environment and playing with working examples like this help tremendously in overcoming the learning curve.
Thank you for this tutorial and the github files!
I just finished building my MongoDB CRUD editor. This is replacing the MySQL CRUD editor I had built using PHP.
Now I can move onto the next phase which is Passport.js
After that I will be able to get the Natural Language processing scripts back up.
I’ll let you know when it’s done and set you up with a free demo account. 🙂
Okay, I got it working. I had to make two changes.
1) the directory “layout” has to be called “layouts”
2) mongoose.connect(‘localhost:27017/nodeapp’); needs to be mongoose.connect(‘mongodb://localhost:27017/nodeapp’);
Hi,
You can either include the CDN (In this example, I have added the bootstrap CDN in the layout.hbs file or you can serve them through the public/stylesheets directory.
I am using express-handlebars with Nodejs. Al i have been integrated and create many custom helpers.
But problem is when i create custom helper using mongoose inside and try to get result onto handlebar template. Seriously, no luck. Everytime blank.
I read lot articles to create custom helper. I did it. But same no luck.
Can you please help me ?
Dude.. nice article.. I was trying to follow the tutorial by copy pasting the content.. there are some typeos. Please check them.. Otherwise liked the tut.
Hello when I clone your repo and follow the instructions via read me (npm install & npm start) I get the following error below:
(node:9710) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client
>If your package.json already consists a “test” object with some different value, replace it with the code given above. Once done, your scripts object might look like this.
With this particular `react-scripts` example, it doesn’t sound right. If you use Create React App **it already includes Jest**. There is no need to add it once again explicitly. You would just make it incompatible with Create React App future updates. Could you please clarify that this guide is not for Create React App users?
Thanks Dan for clarifying that and taking the time to contribute! I have updated this article with changes.
Article is written in a lucid manner and is very informative.
I was able to follow along with this up until creating the model and then i started getting errors.
I think some formatting is lost in the model, where content.js is mentioned.
does that code snippet replace everything in index.hbs?
the error I’m getting is `ReferenceError: router is not defined`
Any chance you would be able to put the completed code up on github?
Hi Brandon, I will try and put up the code on GitHub and share with you.
Awesome, thank you! I’m rewriting my voice interface app in a NodeJS + MongoDB environment and playing with working examples like this help tremendously in overcoming the learning curve.
Here is the link to the GitHub repo: https://github.com/adityaekawade/node-express-mongo-mongoose
All the best to your voice interface app! I hope you are enjoying rewriting it. I would like to have a look at it once its complete 🙂
Thank you for this tutorial and the github files!
I just finished building my MongoDB CRUD editor. This is replacing the MySQL CRUD editor I had built using PHP.
Now I can move onto the next phase which is Passport.js
After that I will be able to get the Natural Language processing scripts back up.
I’ll let you know when it’s done and set you up with a free demo account. 🙂
Awesome. I look forward to it!
Okay, I got it working. I had to make two changes.
1) the directory “layout” has to be called “layouts”
2) mongoose.connect(‘localhost:27017/nodeapp’); needs to be mongoose.connect(‘mongodb://localhost:27017/nodeapp’);
Thank you Brandon,
I have updated the article with the following: mongoose.connect(‘mongodb://localhost:27017/nodeapp’);
It still have to be named “layouts” not “layout”
Thank you
Can you tell me how to include css file ?
Hi,
You can either include the CDN (In this example, I have added the bootstrap CDN in the layout.hbs file or you can serve them through the public/stylesheets directory.
I am using express-handlebars with Nodejs. Al i have been integrated and create many custom helpers.
But problem is when i create custom helper using mongoose inside and try to get result onto handlebar template. Seriously, no luck. Everytime blank.
I read lot articles to create custom helper. I did it. But same no luck.
Can you please help me ?
Dude.. nice article.. I was trying to follow the tutorial by copy pasting the content.. there are some typeos. Please check them.. Otherwise liked the tut.
how can get the _id in loop?
{{# each contents }}
{{ this.title }}
{{ this.author}}
{{ this.description }}
{{/each}}
Hello when I clone your repo and follow the instructions via read me (npm install & npm start) I get the following error below:
(node:9710) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See http://mongoosejs.com/docs/connections.html#use-mongo-client