Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6845843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:33:01+00:00 2026-05-27T00:33:01+00:00

I currently have node.js, express, and mongodb in my heroku environment. What I want

  • 0

I currently have node.js, express, and mongodb in my heroku environment.

What I want to know is how do I get a user’s input (example: they’re signing up for an account and they’re inputting their username and password) and save it in mongodb then get that information later (example: they’re logging in).

Do I make a connection from a .js script to mongodb or how does it work exactly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:33:02+00:00Added an answer on May 27, 2026 at 12:33 am

    Are you trying to utilize Node.js as the backend server for handling data? Will node.js be rendering the HTML pages?

    Assuming that you simply want to use Node.js for inserting or finding data, take a look at Express.

    Alternatively, you can do use the url library for processing incoming requests and then pass them off to Mongo using the methods provided by a library such as node-mongodb-native.

    The node-mongodb-native driver gives you all the core MongoDB functionality, but depending on the complexity of your application, it might make more sense to use a framework or a mongodb library that also does data modeling.

    Take a look at this Node modules list to see what all the options are.

    As for the architecture, one example is to POST user credentials to Node.js which parses them and connects to MongoDB to pull the user’s account info. MongoDB returns to Node.js the data it finds, and your Node server outputs the user account info in a JSON format. I’m not sure if that’s what you were asking, but it’s one simple approach that would be easy to build once you’re familiar with the flow of callbacks and all that other tasty spaghetti 😉


    Here’s a little CoffeeScript snippet from a Node.js application I use to connect to Mongo and start the Node.js server:

    db = new mongo.Db('tracker', new mongo.Server('127.0.0.1', 27017, {auto_reconnect: true}))
    
    # Open the connections:
    db.open (db_error, database) ->
    
      console.error "Unable to open connection to database 'tracker': #{db_error}" if db_error
    
      # Launch server on port 8080:
      http.createServer(onRequest).listen 8080, '127.0.0.1'
    
      # Close the connection if the server is stopped:
      db.close()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to parse the following HTML. What I currently have is var node
I'm currently using Express 2.x Node 0.8.x Do I have to pass key and
I have a node.js Express application with a basic user authentication system where the
I have a search engine written in node.js/express that is currently not logging any
Currently i have a node.js and socket.io application in development on my local machine
So I currently have a XML Node at the Item level: <Item> <Item_Number>0000000063089</Item_Number> <English_Description>MOUNTAIN
I currently have a form with inputs and name attributes. I'm able to get
I currently have some XML similar to the following <First Node> <Second Node> <Third
I currently have def list(node: NodeSeq): NodeSeq = { val all = Thing.findAll.flatMap({ thing
I currently have this line of code which I want to work in all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.