Intro to Vue.js and Delete Post UI
Fullstack Social iOS NodeJS REST
To make our lives as simple as possible, I would like to introduce a very popular javascript framework called Vue.js. Using this library will accomplish two important things inside of our web pages. The first is to eliminate the usage of weird % symbols in our code, its very hard to type in my opinion. Secondly, its much easier to use two way binding syntax in our web pages to update the UI and handle things like clicking buttons. Today's lesson will be a quick intro to Vue.js, I do recommend you go through some of the "Getting Started" guides on the internet to get more familiar with the syntax. By the end of today's video, we'll have functional UI that helps us delete post objects from the browser.

Comments (5)
sirybob
4 years ago
Hey Brian....just a FYI the video is missing above :)
Brian Voong
4 years ago
omari
3 years ago
Hi Brian, my app crashes because I cannot connect to mlab. Error: ------------------------------------------------- name: 'MongoError', message: 'failed to connect to server [ds241968.mlab.com:41968] on first connect [Error [MongoError]: connection 0 to ds241968.mlab.com:41968 timed out\n' + ' at Function.MongoError.create (/Users/m/Desktop/sails_sandbox/web_social/node_modules/mongodb-core/lib/error.js:29:11)\n' + ' at Socket.<anonymous> (/Users/m/Desktop/sails_sandbox/web_social/node_modules/mongodb-core/lib/connection/connection.js:200:20)\n' + ' at Object.onceWrapper (events.js:299:28)\n' + ' at Socket.emit (events.js:210:5)\n' + ' at Socket._onTimeout (net.js:468:8)\n' + ' at listOnTimeout (internal/timers.js:531:17)\n' + ' at processTimers (internal/timers.js:475:7) {\n' + " name: 'MongoError',\n" + " message: 'connection 0 to ds241968.mlab.com:41968 timed out'\n" + '}]' } [nodemon] app crashed - waiting for file changes before starting... ------------------------------------------------- There is no option to restart my mlab database server. ( https://docs.mlab.com/ops/ ). It says If you are on a single-node plan, your database server will be restarted which typically involves approximately 20 seconds of downtime. Sandbox database limitations Because our Sandbox databases are shared by multiple users, restarting MongoDB on-demand is not possible. If you suspect a restart is required, contact support@mlab.com. BTW can you please explain why we are using mlab and Amazon S3?
omari
3 years ago
In the development and utility section on the mlab website its says that my database is up and running....
omari
3 years ago
If I try to connect to the server from Robo 3T it says. Cannot connect to the MongoDB at ds241968.mlab.com:41968. Error: Network is unreachable. Reason: couldn't connect to server ds241968.mlab.com:41968, connection attempt failed: SocketException: Error connecting to ds241968.mlab.com:41968 (52.18.76.154:41968) :: caused by :: Operation timed out
Brian Voong
3 years ago
omari
3 years ago
Hi Brian everything worked fine till today. I just wanted to run the code and did not change anything and it threw that error message. Even when just trying to connect to my database with Robo 3T it says ---------- Cannot connect to the MongoDB at ds241968.mlab.com:41968. Error: Network is unreachable. Reason: couldn't connect to server ds241968.mlab.com:41968, connection attempt failed: SocketException: Error connecting to ds241968.mlab.com:41968 (52.18.76.154:41968) :: caused by :: Operation timed out ----- I did not changed any credentials on Robo 3T or mlab
Brian Voong
3 years ago
omari
3 years ago
My DB is not deleted. I can still edit my database on the mlab website. On their website it says the database is up and running. When testing the connection from Robo 3T it says Failed to connect to ds241.. Is the only change to delete the database and set it up again :( ?
omari
3 years ago
Hi Brian, it was so horrible... I deleted the database and created a new one and had the same error. Then I connected my device to another wifi network and it worked again. My whole day is gone... The problem is that if the query takes longer than 30sec to send its first result, it'll end with a connection timed out error. If the query takes more than 30sec between two results, it'll probably end with that connection closing due to pool shrinking. Options are to increase timeouts, or make sure your query is fast enough ( create an index for example). The advise is to speed up query, since increasing timeouts may have performances downsides. It would be awesome if you could talk about that issue.
gabedelvillar
3 years ago
Why Vue.js over React.js? Just curious. Also, as striving for a jr. iOS developer role, do you think having a Vue.js/React.js project or two in my portfolio would benefit?
Udin Rajkarnikar
3 years ago
hello brain, can you explain the filter function?
gerkov77
3 years ago
Hi there, I have noticed that other participants are already commenting about this, but I am on MongoDB Atlas, not mLab, and since yesterday I also have problems reconnecting to this service! What causes this? Maybe as a free service they are not providing this for more than 2 days? Can I just leave Mondo DB Atlas, and move this part of the project to AWS too? Is it very expensive to do so, or included in the price we are now paying anyway? Maybe some guide would be nice on this topic. Or maybe just a link referencing a guide elsewhere. Also I have got this error message: Error" : Could not tear down the ORM hook. Error details: Error: Consistency violation: Attempting to tear down a datastore (`default`) which is not currently registered with this adapter. This is usually due to a race condition in userland code (e.g. attempting to tear down the same ORM instance more than once), or it could be due to a bug in this adapter. (If you get stumped, reach out at http://sailsjs.com/support.)" I have noticed, that i have -- adapter: "connect.mongo" -- on session.js, but -- adapter: "sails-mongo" -- in datastore.js later part of the Error: " /Users/gergelykovacs/Dev/fullstack_social_lbta/web_social/node_modules/mongodb/lib/mongo_client.js:421 throw err ^ Error [MongoError]: connection 3 to cluster0-shard-00-01.iqbm6.mongodb.net:27017 closed at Function.MongoError.create (/Users/gergelykovacs/Dev/fullstack_social_lbta/web_social/node_modules/mongodb-core/lib/error.js:29:11) at TLSSocket.<anonymous> (/Users/gergelykovacs/Dev/fullstack_social_lbta/web_social/node_modules/mongodb-core/lib/connection/connection.js:214:22) " Thanks, Greg
gerkov77
3 years ago
I also can't connect with Compass anymore! Any tips for this? I cannot continue this tutorial ad long as it does not work!
Brian Voong
3 years ago
gerkov77
3 years ago
I have deleted the cluster, created a brand new one. Nodemon is still crashing. Is this what you meant by a new instance, or to rewrite the app? The app worked until like two days ago, after which I didn't touch it, but started crashing. (Happened first time, when I tried to demo to a client.) Your downloaded material runs fine with your settings and db though. I could try to diff out every file, but Compass still cannot connect to this new cluster either. So the problem is lying somewhere around the mongo connection. Error: Users/gergelykovacs/Dev/fullstack_social_lbta/web_social/node_modules/mongodb/lib/mongo_client.js:421 throw err ^ Error [MongoError]: connection 3 to fullstack-greg-shard-00-02.iqbm6.mongodb.net:27017 closed at Function.MongoError.create (/Users/gergelykovacs/Dev/fullstack_social_lbta/web_social/node_modules/mongodb-core/lib/error.js:29:11) at TLSSocket.<anonymous> (/Users/gergelykovacs/Dev/fullstack_social_lbta/web_social/node_modules/mongodb-core/lib/connection/connection.js:214:22) at Object.onceWrapper (events.js:417:26) at TLSSocket.emit (events.js:322:22) at net.js:672:12 at Socket.done (_tls_wrap.js:557:7) at Object.onceWrapper (events.js:417:26) at Socket.emit (events.js:310:20) at TCP.<anonymous> (net.js:672:12) [nodemon] app crashed - waiting for file changes before starting...
Brian Voong
3 years ago
gerkov77
3 years ago
Ok, finally I was able to connect to Mongo Atlas, then lift the app. The mistake I was doing __after creating the new cluster__ , that I added my login-password in the URL. Instead I should have added the password I was using with the deleted cluster. Not sure why and, where to set the passwords for the clusters. (maybe for database users rather). Also not clear why the closing of the previous cluster happened, and how long the new one gonna last! But at least I can continue the course now! Thanks for the support!
HELP & SUPPORT