payservedb 2.3.4 → 2.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -4
- package/package.json +1 -1
- package/src/models/john.js +9 -0
- package/src/models/waitlist.js +2 -1
package/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const mongoose = require('mongoose');
|
|
2
2
|
require('dotenv').config()
|
|
3
|
-
|
|
4
|
-
const WaterConcentrator = require('./src/models/waterConcentrator');
|
|
3
|
+
|
|
5
4
|
|
|
6
5
|
// Maintain a record of open connections for each database
|
|
7
6
|
const connections = {};
|
|
@@ -11,8 +10,7 @@ const source = '?authSource=admin'
|
|
|
11
10
|
// Utility function to connect to MongoDB
|
|
12
11
|
async function connectToMongoDB(dbName) {
|
|
13
12
|
try {
|
|
14
|
-
|
|
15
|
-
// const authorization = "Ps:Letmein987@"
|
|
13
|
+
|
|
16
14
|
const connectionString = `mongodb://Ps:Letmein987@127.0.0.1:27017/${dbName}${source}`;
|
|
17
15
|
await mongoose.connect(connectionString, {
|
|
18
16
|
useNewUrlParser: true,
|
|
@@ -83,6 +81,7 @@ const models = {
|
|
|
83
81
|
Penalty: require('./src/models/penalty'),
|
|
84
82
|
Reminder: require('./src/models/reminder'),
|
|
85
83
|
BankDetails: require('./src/models/bankdetails'),
|
|
84
|
+
John:require('./src/models/john')
|
|
86
85
|
};
|
|
87
86
|
|
|
88
87
|
// Function to get models dynamically from a specific database connection
|
package/package.json
CHANGED
package/src/models/waitlist.js
CHANGED
|
@@ -33,7 +33,8 @@ const waitListSchema = new mongoose.Schema({
|
|
|
33
33
|
type: mongoose.Schema.Types.ObjectId,
|
|
34
34
|
ref: 'Facility',
|
|
35
35
|
required: true // Ensures a facilityId is always provided
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
|
+
|
|
37
38
|
}, {
|
|
38
39
|
timestamps: true // Automatically add createdAt and updatedAt fields
|
|
39
40
|
});
|