1
vote
0answers
37 views

Twitch chat bot using node, express, mongodb

I need help on truly understanding my self project. Javascript is a language I struggle the most with so I decided to create a project using Javascript. In my education I'm mostly familiar with C++, ...
0
votes
0answers
34 views

Optimizing a long Node.js POST request

The request below takes very long on slower internet connections and Heroku is throwing a Request Timeout error for many users. The API request is being made by ...
0
votes
0answers
18 views

Reuse MongoDB connection in Express application

So I think the title is pretty straightforward. I implement a client for MongoDB and I want to include it anywhere in my app and share the connection (not create it always or close it always). So my ...
1
vote
1answer
45 views

Scoping and asynchronous function

I have the following code where I need to return an array of objects as a response that has values from the server. The objects are filled with the right values, but when they are pushed into the ...
2
votes
0answers
27 views

Create a stream request for Transaction history by client id on Braintree vault

I have been trying to create a transaction history request from Braintree using a client ID on Braintree vault, and it took far too long to figure out how, so here is the code on server that I ...
0
votes
0answers
89 views

A URL Shortener with express/mongodb/nodejs

please give feedback on anything you think I could improve on. This is a URL shortener that I did from the freecodecamp challenges. Here are some things I would like feedback on: -My functions, do ...
1
vote
1answer
45 views

Loading information about a competition every time the page is loaded

I am using KeystoneJS to manage data and my APIs (which includes Node.js, MongoDB, and Express.js). It uses Mongoose to connect with MongoDB; Keystone queries are essentially the same as Mongoose ...
5
votes
3answers
202 views

Verifying requirements before deleting a user-parent-student-school relationship

I am new to node, after I finished my APIs I realized that all of them are a mess, and are a callback hell, this forced me to learn about promises, now it was all good until I faced an API that has ...
1
vote
0answers
46 views

MongoDB Per-Module Reusable DB Object With Reconnection Handled

This implementation was derived from the following requirements. I would like to learn that whether the implementation is clean enough, without memory leak and performance hit. Requirements Always ...
2
votes
0answers
152 views

Managing modules in phone book app

This is a test app built with NodeJS, Express and MongoDB. This code is the main and complete JavaScript file. I would like suggestions on dividing it into different modules and making the main app.js ...
2
votes
0answers
61 views

Properly updating multiple MongoDB documents with Angular

In the app I'm creating, when a user upvotes a post, the post should be upvoted, as well as the user that wrote the post. But this updates two MongoDB documents. This presents a number of issues. I'll ...
8
votes
1answer
67 views

Retrieving StackExchange sites and tags

I have setup agenda tasks to periodically retrieve and possibly insert new SE sites and tags in my MongoDB database. Some things that bother me in particular: Lots of code duplication No string ...
1
vote
0answers
129 views

Pulling data quickly from mongodb with node.js

I am currently struggling with a request I am making to my server that is taking more than 4 seconds! I cut out a lot of the cruft to hopefully make it easier to read. Excuse my horrible variable ...
2
votes
2answers
154 views

SQL Server to MongoDB Template

Looking for feedback on a set of templates I've just created. I'm planning on converting them to Yeoman but want to make sure they're ready for prime time before doing so. They are currently in ...
15
votes
1answer
233 views

Making an efficient and healthy db call for a real-time browser game

I'm doing a calculation for a real-time browser game, where users can invest some of their balances to the site. I need to update their invest's based on ...
4
votes
2answers
1k views

Modularize this node.js express server code for routes and session handlers?

I have express node.js server code using Passport. It receives a user to authenticate it and ...
2
votes
1answer
395 views

Saving and listing Category model

I have this ExpressJS route for saving and listing Category model. ...