Install mongodb in Ubuntu Desktop 18.04

Installing the official MongoDB packages provided by MongoDB didn’t allow the mongod to start the service and returned the following error:

Failed to start mongod.service: Unit mongod.service not found

That is not good, because that would required me to start the mongodb manually:

mongod –dbpath some-path/to-store-mongodb-db-data

Instead, I installed the unofficial mongodb package provided by Ubuntu, and it just works fine when I start the service:

sudo systemctl start mongodb

Advertisements

Data path “.name” should match format “html-selector”.

If you read this blog post title carefully, that’s what I got when attempted to generate a new application with the following name, app-1.

Here is the complete error output:

Schematic input does not validate against the Schema: {“name”:”app-1″,”version”:”6.0.8″,”newProjectRoot”:”projects”,”skipInstall”:false,”linkCli”:false,”skipGit”:false,”commit”:null}
Errors:

Data path “.name” should match format “html-selector”.

Seems to be we can’t have numeric characters in the application name. I wonder how that looks like when could have the name being used in the template:

<app-1-root></app-1-root>

That doesn’t look good, yes?

Luckily, the ng new command prevented that from the beginning.

Playing out with fixed value of the position CSS property

After several times learning and playing out with fixed value of the position CSS property. I think is not that hard to create the fixed navigation bar without relying on a CSS framework (e.g. Bootstrap or Foundation Zurb), and really, going down one level to understand how things really work is really satisfying.

The other important thing I should understand later is the concept of Layout and the containing block, because most of the CSS position values will behave relative to the containing block.

 

 

Run MongoDB in local environment using Docker

Running MongoDB in local environment using Docker without installing the MongoDB server would be my preference since I use Docker. The reason is obvious, I don’t want to clutter my development environment with a bunch of database server installations.

With Docker installed on development environment I could just simply execute the following command to spin up a new MongoDB server running in a container:

docker run -d -p 27017:27017 –name=local-mongodb mongo:3.6

But, still to connect with the database you would need a client, in my case, I simply installed the mongodb-org-shell and use it to connect to the MongoDB database running in the container. The earlier command I showed to you will run the MongoDB container and expose the 27017 port to the host machine. Connecting to the MongoDB in the container would simply just executing the following command on the CLI:

mongo

I use this approach in several projects, and I am quite happy.

I think I should try PWA

After I took a getting started course on PWA, I feel like I need to build something using this set of technologies. One of the notable features I like from it is the ability to have it added to the home screen and without installing a native app that might use a relatively bigger storage. The other things I feel excited about is when I tried several PWA-based apps, it feels like I’m really using a native app, it’s pretty close.