MongoDB & AWSCluster All In One
Cloud Databases
mLab
mLab 是托管 MongoDB 数据库的完全托管的云数据库
服务。
https://mlab.com/
=> https://www.mongodb.com/atlas/database
mongodb cloud
https://cloud.mongodb.com/v2/5e3fabf3014b76a5963c67aa#clusters/connect?clusterId=AWSCluster
connection method
https://www.mongodb.com/docs/atlas/connect-to-database-deployment/#connect-to-a-cluster
mongodb+srv://test:<password>@awscluster.rulye.mongodb.net/?retryWrites=true&w=majority
$ brew install mongosh
$ mongosh "mongodb+srv://awscluster.rulye.mongodb.net/myFirstDatabase" --apiVersion 1 --username test
https://downloads.mongodb.com/compass/mongodb-compass-1.33.1-darwin-x64.dmg
mongodb+srv://test:<password>@awscluster.rulye.mongodb.net/test
mongodb+srv://test:<password>@awscluster.rulye.mongodb.net/test
https://www.mongodb.com/docs/mongodb-vscode/playgrounds/
https://www.mongodb.com/docs/atlas/troubleshoot-connection/
const { MongoClient, ServerApiVersion } = require('mongodb');
//
const uri = "mongodb+srv://test:<password>@awscluster.rulye.mongodb.net/?retryWrites=true&w=majority";
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true, serverApi: ServerApiVersion.v1 });
client.connect(err => {
const collection = client.db("test").collection("devices");
// perform actions on the collection object
client.close();
});
mongoose
https://mongoosejs.com/docs/index.html
https://github.com/Automattic/mongoose
TypeORM
https://github.com/typeorm/typeorm
Supports
MongoDB
NoSQL database. ?
https://github.com/typeorm/mongo-typescript-example
https://github.com/typeorm/typeorm/blob/master/docs/supported-platforms.md#nodejs
refs
©xgqfrms 2012-2020
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 ️,侵权必究⚠️!