create account

Postman with NodeJS and MongoDB by taradraz1

View this thread on: hive.blogpeakd.comecency.com
· @taradraz1 ·
$2.95
Postman with NodeJS and MongoDB
### <center>Postman with NodeJS and MongoDB</center>
<div class="text-justify">
<center>


Hello people of Hive, in this case, I will show how we add data with the functions we made in the last post, here we use our database and the express server with node to connect and we use Postman a great tool to test backend code. You can download the Desktop App easily and execute

![postman1.png](https://files.peakd.com/file/peakd-hive/taradraz1/23tSb3DQRSzVAgeqpeGeaBmwwsJPWVWkVSwD6F1GgbvYrMKb6u19DPHRsWinFARianG4p.png)

First, we will see here the stuff we need to install using npm we install express, mongoose 6.10 in this case, and body-parser, and then we can node server.js to start our server we can also see in mongolink we use the link that our mongo cluster shows to us and the password from the user, we can go explore on mongo or check the other posts to see this.

![postman2.png](https://files.peakd.com/file/peakd-hive/taradraz1/23t74ySHtP3E32M2PaaTqBzUSuRMP1vDF9y1gcqPES8EqcdaqpYnLK2KBGsevwLdZP9dz.png)

We made 2 functions in the past post, and now we will use them to add data to the database, if we remember we made an add function for the user or client, here we just add localhost the port we using in this case and we add the router we made the last post, here we just send the data from body params and we select URL-encoded, we use the key value

![postman3.png](https://files.peakd.com/file/peakd-hive/taradraz1/23t8CfKjGvtpbvrJk6g63ZN1pK1Fe41hhi3m1dWJJJvnWqtuEz5jUPGPBdmgxMZuddFpw.png)

Here I will check in the Datababase Collections and we can see the client we just added is working well, we also have the id that mongo creates by default. We can see the Data is JSON, this is the advantage of using MongoDB, the data is stored in JSON and we can access it in the same way, which is helpful for integration.

![postman4.png](https://files.peakd.com/file/peakd-hive/taradraz1/23swbiMKu5VnLgVMd8NZfGie942fUwFs6G34xpfYmpvNbqBwab5s9Z35ocQFRgGCkA4ME.png)

Finally, we will add data to the product collection with the function in the router /create, we just send the value in needs and we also can see in Postman the Status 200 OK, and the JSON in the bottom, that's the same data that we are saving in the MongoDB Database.

![postman5.png](https://files.peakd.com/file/peakd-hive/taradraz1/23t8CfKPx6Z9ocHSVFc48eFemtKmNEDDcSMhH3P7pnsFaSifk7JAMZkPhvWU8X6mdbXS2.png)


Thank you very much to all for your attention, we can now see the JSON collections in mongoDB we also started an easy server with 2 functions that help to add data with Postman, I hope you find this information useful for your programming.


You can check my blog here: https://peakd.com/@taradraz1

Also if you have questions you can leave them in the comments and I can answer them so we can keep getting better, remember to check the last post and make sure you install all it needs to work!!!

</div>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 269 others
properties (23)
authortaradraz1
permlinkpostman-with-nodejs-and-mongodb
categoryhive-196387
json_metadata"{"app":"peakd/2023.11.3","format":"markdown","description":"In this guide we are using Postman with NodeJS and MongoDB to add data using model and controllers previously made","portfolio":true,"tags":["stem","dev","stemsocial","chessbrothers","programming","ocd","ocdb","tutorial","stemgeeks","curangel"],"users":["taradraz1"],"image":["https://files.peakd.com/file/peakd-hive/taradraz1/23tSb3DQRSzVAgeqpeGeaBmwwsJPWVWkVSwD6F1GgbvYrMKb6u19DPHRsWinFARianG4p.png","https://files.peakd.com/file/peakd-hive/taradraz1/23t74ySHtP3E32M2PaaTqBzUSuRMP1vDF9y1gcqPES8EqcdaqpYnLK2KBGsevwLdZP9dz.png","https://files.peakd.com/file/peakd-hive/taradraz1/23t8CfKjGvtpbvrJk6g63ZN1pK1Fe41hhi3m1dWJJJvnWqtuEz5jUPGPBdmgxMZuddFpw.png","https://files.peakd.com/file/peakd-hive/taradraz1/23swbiMKu5VnLgVMd8NZfGie942fUwFs6G34xpfYmpvNbqBwab5s9Z35ocQFRgGCkA4ME.png","https://files.peakd.com/file/peakd-hive/taradraz1/23t8CfKPx6Z9ocHSVFc48eFemtKmNEDDcSMhH3P7pnsFaSifk7JAMZkPhvWU8X6mdbXS2.png"]}"
created2023-12-15 01:48:00
last_update2023-12-15 01:48:00
depth0
children5
last_payout2023-12-22 01:48:00
cashout_time1969-12-31 23:59:59
total_payout_value1.380 HBD
curator_payout_value1.569 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,893
author_reputation14,630,618,255,247
root_title"Postman with NodeJS and MongoDB"
beneficiaries
0.
accountmidnight-studio
weight1,000
1.
accountstemsocial
weight500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,679,490
net_rshares7,001,319,730,429
author_curate_reward""
vote details (333)
@dobro2020 ·
great explanation, short and simple :D
👍  ,
properties (23)
authordobro2020
permlinks5qq5f
categoryhive-196387
json_metadata{"app":"hiveblog/0.1"}
created2023-12-16 03:39:15
last_update2023-12-16 03:39:15
depth1
children0
last_payout2023-12-23 03:39:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length38
author_reputation66,396,989,968,772
root_title"Postman with NodeJS and MongoDB"
beneficiaries
0.
accounthiveonboard
weight100
1.
accounttipu
weight100
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,706,785
net_rshares81,098,573
author_curate_reward""
vote details (2)
@gwajnberg ·
Postman is a very interesting tool to test your api, I really enjoy it, there are some other alternatives but I didn't test it yet.

<center>https://files.peakd.com/file/peakd-hive/dlmmqb/23tkn1F4Yd2BhWigkZ46jQdMmkDRKagirLr5Gh4iMq9TNBiS7anhAE71y9JqRuy1j77qS.png</center>

<center> <b>
Want to Know more about Hivepakistan? 

Ping Us On [Hive Pakistan Discord server](https://discord.gg/3FzxCqFYyG)

To support HivePakistan, delegate Hive Power to hivepakistan and earn 90% curation reward :) 

Here are some handy links for delegation

</b>
</center>

<center>| [50 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=50%20HP) | [100 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=100%20HP) |[500 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=500%20HP) | [1000 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=1000%20HP) | [5000 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=5000%20HP) | [10000 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=10000%20HP) | [20000 HP](https://hivesigner.com/sign/delegateVestingShares?delegator=&delegatee=hivepakistan&vesting_shares=20000%20HP) |

A delegation of 500 or more HP makes you earn Hivepakistan supporter badge.

</center>
👍  , ,
properties (23)
authorgwajnberg
permlinkre-taradraz1-20231215t134858519z
categoryhive-196387
json_metadata{"tags":["stem","dev","stemsocial","chessbrothers","programming","ocd","ocdb","tutorial","stemgeeks","curangel"],"app":"ecency/3.0.37-vision","format":"markdown+html"}
created2023-12-15 20:48:57
last_update2023-12-15 20:48:57
depth1
children1
last_payout2023-12-22 20:48:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,498
author_reputation372,224,139,487,200
root_title"Postman with NodeJS and MongoDB"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,699,273
net_rshares3,275,727,849
author_curate_reward""
vote details (3)
@taradraz1 ·
Thanks!! yes, it's a great tool i am using it a lot right now!!
👍  ,
properties (23)
authortaradraz1
permlinkre-gwajnberg-20231215t175641478z
categoryhive-196387
json_metadata{"tags":["stem","dev","stemsocial","chessbrothers","programming","ocd","ocdb","tutorial","stemgeeks","curangel"],"app":"ecency/3.0.37-vision","format":"markdown+html"}
created2023-12-15 22:56:42
last_update2023-12-15 22:56:42
depth2
children0
last_payout2023-12-22 22:56:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length63
author_reputation14,630,618,255,247
root_title"Postman with NodeJS and MongoDB"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,702,088
net_rshares81,255,026
author_curate_reward""
vote details (2)
@hivebuzz ·
Congratulations @taradraz1! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/http://hivebuzz.me/@taradraz1/upvoted.png?202312150313"></td><td>You received more than 8000 upvotes.<br>Your next target is to reach 9000 upvotes.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@taradraz1) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out our last posts:**
<table><tr><td><a href="/hive-122221/@hivebuzz/lpud-202312"><img src="https://images.hive.blog/64x128/https://i.imgur.com/pVZi2Md.png"></a></td><td><a href="/hive-122221/@hivebuzz/lpud-202312">LEO Power Up Day - December 15, 2023</a></td></tr></table>
properties (22)
authorhivebuzz
permlinknotify-taradraz1-20231215t033749
categoryhive-196387
json_metadata{"image":["http://hivebuzz.me/notify.t6.png"]}
created2023-12-15 03:37:48
last_update2023-12-15 03:37:48
depth1
children0
last_payout2023-12-22 03:37:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length913
author_reputation369,398,197,688,618
root_title"Postman with NodeJS and MongoDB"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,681,033
net_rshares0
@stemsocial ·
re-taradraz1-postman-with-nodejs-and-mongodb-20231215t221400399z
<div class='text-justify'> <div class='pull-left'>
 <img src='https://stem.openhive.network/images/stemsocialsupport7.png'> </div>

Thanks for your contribution to the <a href='/trending/hive-196387'>STEMsocial community</a>. Feel free to join us on <a href='https://discord.gg/9c7pKVD'>discord</a> to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

Thanks for including @stemsocial as a beneficiary, which gives you stronger support.&nbsp;<br />&nbsp;<br />
</div>
properties (22)
authorstemsocial
permlinkre-taradraz1-postman-with-nodejs-and-mongodb-20231215t221400399z
categoryhive-196387
json_metadata{"app":"STEMsocial"}
created2023-12-15 22:14:00
last_update2023-12-15 22:14:00
depth1
children0
last_payout2023-12-22 22:14:00
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length545
author_reputation22,918,491,691,707
root_title"Postman with NodeJS and MongoDB"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id129,701,252
net_rshares0