简体   繁体   English

我正在尝试将 Angular 连接到 MongoDB

[英]I am trying to connect Angular to MongoDB

I have a simple Angular app and it is running in Local Host 4200. How do I save the form values and store them in a MongoDB database?我有一个简单的 Angular 应用程序,它在本地主机 4200 中运行。如何保存表单值并将它们存储在 MongoDB 数据库中?

  • Angular is a web framework dedicated for the client-side, MongoDB is a NoSQL database, to save your data put into your angular app to your Database, you need a server-side implementation like nodejs or python, java, etc.. Angular is a web framework dedicated for the client-side, MongoDB is a NoSQL database, to save your data put into your angular app to your Database, you need a server-side implementation like nodejs or python, java, etc..

  • I recommend for you to use expressjs as an API framework it can helps you to get started我建议您使用expressjs作为 API 框架,它可以帮助您入门

Angular is not supposed to connect directly to a DB in an real project, so there is not much of a point to practice doing so. Angular 不应该直接连接到实际项目中的数据库,因此练习这样做没有太大意义。 You should have an server-side application or a mock to do so.您应该有一个服务器端应用程序或一个模拟来执行此操作。 If you are trying to build a front for studies you can use packages such as this one to begin: https://www.npmjs.com/package/auto-api如果你想建立一个研究的前沿,你可以使用这样的包开始: https://www.npmjs.com/package/auto-api

It is of simple use and you can save data without configuring or installing a DB.它使用简单,无需配置或安装数据库即可保存数据。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我正在尝试将 mongodb 服务器与节点连接 - I am trying to connect mongodb server with node 尝试将节点 js 与 mongoDB Atlas cloud 连接时出现 UnhandledPromiseRejectionWarning 错误 - I am getting UnhandledPromiseRejectionWarning error when trying to connect node js with mongoDB Atlas cloud 我正在尝试从Express应用程序连接到MongoDB。 我认为我的连接字符串抛出语法错误 - I am trying to connect to connect to MongoDB from my Express Application. It is throwing a syntax error at my connection string I think 出现错误:querySrv ECONNREFUSED _mongodb._tcp.auctiondbcluster.s6rzg.mongodb.net。 当我离线时尝试连接到 localhost - Getting Error: querySrv ECONNREFUSED _mongodb._tcp.auctiondbcluster.s6rzg.mongodb.net. When trying to connect to localhost when I am offline 我正在尝试从 mongodb 连接我的 server.js express api 但它显示一些错误我不明白 - I am trying to connect my server.js express api from mongodb but it showing some error i don't understand it 我努力将节点与 MongoDB 连接的原因 - Reasons why am I struggling to connect node with MongoDB 我无法将我的 MongoDb 与 Vs 代码连接起来 - I am unable to connect my MongoDb with Vs code 如何连接 angular 7 与 mongodb - How to connect angular 7 with mongodb 我正在尝试使用 nodejs 在 mongodb 中使用填充,但没有填充值 - I am trying to use populate in mongodb with nodejs, but values are not populating 我正在尝试在 atlas mongoDB 上添加多个用户 - i am trying to add multiple users on a atlas mongoDB
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM