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 7407621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:45:15+00:00 2026-05-29T05:45:15+00:00

I am try to set up an environment using Node.js and MongoDB on an

  • 0

I am try to set up an environment using Node.js and MongoDB on an installation of ubuntu. I am able to start a mongo database shell by running the mongo command. But I am unsure of how to accomplish a couple things.

  • How do I set up MongoDB to run persistently, so that I can connect to it?
  • How do I connect to a certain MongoDB database from within Node.js once it is up and running?

I have the mongoose package installed, but I am still confused on how to connect to a particular database with it.

  • 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-29T05:45:16+00:00Added an answer on May 29, 2026 at 5:45 am

    How do I set up MongoDB to run persistently, so that I can connect to it?

    Depends on how you installed the MongoDB.

    If you used the whole apt-get installation process, it generally installs an init.d script and the whole thing just runs with the default settings.

    Try a ps -ef | grep mongod to look for the mongod process.

    If you “installed” by downloading the tar file, then take a look at using upstart or similar process for making it run persistently. You’ll want to use config files.

    How do I connect to a certain MongoDB database from within Node.js once it is up and running?

    Based on the Mongoose page, here is the basic connection process:

    var mongoose = require('mongoose');
    mongoose.connect('mongodb://localhost/my_database');
    

    The standard connection string format is detailed here. Note that in my experience, not all drivers support all of the connection string features equally well, so do test your configuration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to set an attribute in a XML node using MSXML. IXMLDOMElement alone
I'm trying to set up my local development environment, to which i'm using the
I try to start some command from ssh non-interactive ssh connection. I use ant-sshexec
I would like to set up multiple websites in an Intranet environment using IIS
Having issues using the PHP memcached class. I am running a LAMP environment on
I try to set the anchorPoint property, in order to rotate a view by
While we try to set up as many unit tests as time allows for
When I try to set the z variable in the code below, I get
Every time try to set the value of any variable in my model object,
I have try to set icon for my App in the xCode. In the

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.