L
L
learnfrontend002016-12-15 12:27:44
MongoDB
learnfrontend00, 2016-12-15 12:27:44

How to connect a project to mlab?

I cloned the repository from here https://github.com/brunobrito89/udemy-node-angular2.git by default this project is to run on the local mongodb machine and there is the following line:
mongoose.connect('localhost:27017/node-angular');
but I need to connect to mlab. How would I do it?
If add

var uri = 'mongodb://admin:[email protected]:33338/nnnn4';
global.db = mongoose.connect(uri);
global.Schema = mongoose.Schema;

he creates a d5c7e150cc264f4aa76616cde27b01c6.png
collection, and the user all the same does not add.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question