Accabala
Accabala

Reputation: 17

Angular5 MongoDB

I wanted to ask everyone a specification, if I wanted to create a project in Angular5 and as a database I wanted to use MongoDB, should I follow the MEAN programming (MongoDB, Express, Angular, NodeJS) or can I even use ANgular and MOngoDB?

Upvotes: 0

Views: 93

Answers (2)

ufollettu
ufollettu

Reputation: 882

You can use angular with the back-end Technology you prefer, node or php, or .Net etc. You can use mongo without angular, you don't have to care of the front-end. MEAN is a stack that use express as back-end framework. It's simpler than node api, and you can use odm to map mongodb like mongoose. Another advantage is that you will write code in js, in front and back end

Upvotes: 0

Kim Kern
Kim Kern

Reputation: 60357

Angular applications are always on the client side. Hence, you cannot directly use a (classical) database with it. If you want to use mongo, you have to setup a server side application. For this, have a look at nest.js, which is a really great framework for creating server side applications that you can then query via a REST API from your Angular application.

If you don't need a server-side API (e. g. to persist data or do reliable business logic) you can use a client side browser database like IndexDB or LocalStorage.

Another possibility is to use a service like firebase, which gives you the ability to store data on a server without having to setup a full backend.

Upvotes: 2

Related Questions