gettingMean-2 icon indicating copy to clipboard operation
gettingMean-2 copied to clipboard

Chapter 8: connection to local MongoDB failed? data not shown in app

Open MarGer1962 opened this issue 2 years ago • 0 comments

In the map gettingMean-2\my app_ap1\db.js file i have this line of code

let dbURL = 'mongodb://127.0.0.1:27017/Loc8r';

This is shown in my Terminal (Visual Code)

the dbURL (variabele MongoDBLink) = mongodb://127.0.0.1:27017/Loc8r Status: connected to: mongodb://127.0.0.1:27017/Loc8r GET /api/locations?lng=-0.7992599&lat=51.378091&maxDistance=20 200 25.701 ms - 360 GET / 200 290.891 ms - 2110 GET /stylesheets/all.min.css 304 4.611 ms - - GET /stylesheets/style.css 304 6.012 ms - - GET /javascripts/bootstrap.min.js 304 3.355 ms - - GET /javascripts/validation.js 304 3.811 ms - - GET /stylesheets/bootstrap.min.css 200 10.485 ms - 140382 GET /build/polyfills.d1c7bf4a2ae7c3435f95.js 304 8.408 ms - - GET /build/runtime.ec2944dd8b20ec099bf3.js 304 7.213 ms - - GET /build/main.75f3d5241e7dc03e8f49.js 304 7.359 ms - - GET /api/locations?lng=-0.7992599&lat=51.378091&maxDistance=20000 200 3.895 ms - 360 GET /about/ 200 37.011 ms - 2045 GET /stylesheets/bootstrap.min.css 304 1.621 ms - - GET /stylesheets/all.min.css 304 3.825 ms - - GET /stylesheets/style.css 304 3.385 ms - - GET /javascripts/bootstrap.min.js 304 3.805 ms - - GET /javascripts/validation.js 304 4.163 ms - - GET /api/locations?lng=-0.7992599&lat=51.378091&maxDistance=20 200 7.478 ms - 360 GET / 304 44.533 ms - - GET /stylesheets/bootstrap.min.css 304 2.085 ms - - GET /stylesheets/all.min.css 304 2.487 ms - - GET /stylesheets/style.css 304 3.672 ms - - GET /javascripts/bootstrap.min.js 304 2.561 ms - - GET /javascripts/validation.js 304 2.909 ms - - GET /build/runtime.ec2944dd8b20ec099bf3.js 304 5.316 ms - - GET /build/main.75f3d5241e7dc03e8f49.js 304 5.637 ms - - GET /build/polyfills.d1c7bf4a2ae7c3435f95.js 304 5.077 ms - - GET /api/locations?lng=-0.7992599&lat=51.378091&maxDistance=20000 304 5.752 ms - -

So it seems i have a connection with my local MongoDB database Loc8r

This is shown my browser: 2 locations

Terminal dbURL_is_127 0 01-27017-Loc8r

But if i open MongoDB Compass, and use this connection string: mongodb://localhost:27017 Then Go to Loc8r and select locations > in my local mongoDB / Loc8r , 3 locations are shown

Terminal MongoDBCompass localhost_27017

My Question: why do not all 3 locations show in my application/webbrowser?

MarGer1962 avatar Jan 20 '23 16:01 MarGer1962