Skip to content

Commit

Permalink
alter database collection name
Browse files Browse the repository at this point in the history
  • Loading branch information
TuuKeZu committed Aug 16, 2024
1 parent 98b8c17 commit e527403
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/database/lops.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getCourseById = (lops, id) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const query = { code: id }

Expand All @@ -36,7 +36,7 @@ const getCourseType = (lops, id) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const query = { code: id }

Expand Down Expand Up @@ -71,7 +71,7 @@ const getCourseList = (lops) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const projection = {
"_id": 0,
Expand Down
4 changes: 2 additions & 2 deletions src/database/rooms.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const cacheRoom = (room) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

// TODO use these later to see weather room is occupied
const currentDate = (new Date).toLocaleDateString('Fi-fi', { day: '2-digit', month: '2-digit', year: 'numeric' });
Expand Down Expand Up @@ -53,7 +53,7 @@ const getCachedRoom = (id, date = new Date) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');
const queryDate = date.toLocaleDateString('Fi-fi', { day: '2-digit', month: '2-digit', year: 'numeric' }).replaceAll('.', '-');

const query = {
Expand Down
10 changes: 5 additions & 5 deletions src/database/teachers.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getTeacherList = () => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const projection = {
"_id": 0,
Expand Down Expand Up @@ -47,7 +47,7 @@ const getTeacherByName = (name) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const query = { name: name }

Expand All @@ -70,7 +70,7 @@ const getTeacherById = (id) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const query = { hash: id }

Expand Down Expand Up @@ -99,7 +99,7 @@ const rateTeacher = (r) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');
const query = { name: r['teacher'] }

const id = shortid.generate();
Expand Down Expand Up @@ -186,7 +186,7 @@ const deleteComment = (hash, id, secret) => {
MongoClient.connect(url, (err, database) => {
if (err) return reject({ err: 'Failed to connect to database', status: 500 });

const db = database.db('Wilma');
const db = database.db('wilma');

const query = { hash: hash }

Expand Down

0 comments on commit e527403

Please sign in to comment.