getting rid of old collections in code and database

This commit is contained in:
talksik
2022-06-10 06:08:18 -05:00
parent 0eda972f29
commit 68299668a7
3 changed files with 2 additions and 7 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { JwtClaims, authCheck } from '../middleware/auth';
import User, { GoogleUserInfo } from '@nirvana/core/models/user.model';
import User, { GoogleUserInfo, UserStatus } from '@nirvana/core/models/user.model';
import express, { Request, Response } from 'express';
import LoginResponse from '../../core/responses/login.response';
@@ -6,8 +6,6 @@ import environmentVariables from '../config/config';
// Global Variables
export const collections: {
users?: mongoDB.Collection;
lines?: mongoDB.Collection;
lineMembers?: mongoDB.Collection;
} = {};
// Initialize Connection
@@ -21,8 +19,6 @@ client.connect();
const db: mongoDB.Db = client.db(process.env.DB_NAME);
const usersCollection: mongoDB.Collection = db.collection('users');
const lineCollection: mongoDB.Collection = db.collection('lines');
const lineMembersCollection: mongoDB.Collection = db.collection('lineMembers');
// client.on('connection', () => {
// db.command({
@@ -31,7 +27,5 @@ const lineMembersCollection: mongoDB.Collection = db.collection('lineMembers');
// });
collections.users = usersCollection;
collections.lines = lineCollection;
collections.lineMembers = lineMembersCollection;
console.log(`Successfully connected to database: ${db.databaseName} and collections`);
@@ -5,6 +5,7 @@ import React from 'react';
import { SocketProvider } from '../providers/SocketProvider';
import { StabilityProvider } from '../providers/StabilityProvider';
import { Toaster } from 'react-hot-toast';
export default function ElectronApp() {
return (
<StabilityProvider>