MongoDB & AWSCluster All In One

MongoDB & AWSCluster All In One

Cloud Databases

mLab

mLab 是託管 MongoDB 數據庫的完全託管的雲數據庫服務。

https://docs.mlab.com/

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/atlas/troubleshoot-connection/#special-characters-in-connection-string-password

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://typeorm.io/

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, 禁止轉載 🈲️,侵權必究⚠️!


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章