This commit is contained in:
Mr Swift
2024-07-12 23:20:47 +03:30
parent ca8283ffd3
commit 71e1e4b7da
3 changed files with 36 additions and 5 deletions
+2 -5
View File
@@ -1,13 +1,10 @@
/* eslint-disable no-unused-vars */
const mongoose = require('mongoose')
// mongodb database connection string. change it as per your needs. here "mydb" is the name of the database. You don't need to create DB from mongodb terminal. mongoose create the database automatically.
const inHostUrl = 'mongodb://asanserv_admin:admin1234@localhost:27017/asanserv_database'
const outHostUrl =
'mongodb://asanserv_admin:admin1234@www.asan-service.com:27017/asanserv_database?serverSelectionTimeoutMS=5000&connectTimeoutMS=10000&authSource=asanserv_database'
const locaUrl = 'mongodb://localhost:27017/AsanService'
const inHostUrl = 'mongodb://root:KPTt76tImNBBMm4Kor8QA9gB@asan-service:27017/asanserv_database?authSource=admin'
const init = ()=>{
try {
mongoose.connect(outHostUrl, {
mongoose.connect(inHostUrl, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false,