refactor(api): replace mongodb with bson (#67680)

This commit is contained in:
Oliver Eyton-Williams 2026-05-29 21:06:25 +02:00 committed by GitHub
parent 782a99a9df
commit 6b3b8c0949
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 10 additions and 10 deletions

View File

@ -9,7 +9,7 @@ import {
ExamEnvironmentQuestionSet,
ExamEnvironmentChallenge
} from '@prisma/client';
import { ObjectId } from 'mongodb';
import { ObjectId } from 'bson';
import { examEnvironmentPostExamAttempt } from '../src/exam-environment/schemas/index.js';
const defaultUserId = '5bd30e0f1caf6ac3ddddddb5';

View File

@ -17,6 +17,7 @@
"@sentry/node": "9.47.1",
"ajv": "8.20.0",
"ajv-formats": "3.0.1",
"bson": "7.2.0",
"date-fns": "4.1.0",
"date-fns-tz": "3.2.0",
"dotenv": "16.6.1",
@ -27,7 +28,6 @@
"jsonwebtoken": "9.0.3",
"lodash": "4.18.1",
"lodash-es": "4.18.1",
"mongodb": "6.21.0",
"nanoid": "3",
"no-profanity": "1.5.1",
"nodemailer": "6.10.1",

View File

@ -14,7 +14,7 @@ import {
} from 'vitest';
import jwt, { JwtPayload } from 'jsonwebtoken';
import { DailyCodingChallengeLanguage, type Prisma } from '@prisma/client';
import { ObjectId } from 'mongodb';
import { ObjectId } from 'bson';
import { omit } from 'lodash-es';
import { createUserInput } from '../../utils/create-user.js';

View File

@ -1,5 +1,5 @@
import type { FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
import { ObjectId } from 'mongodb';
import { ObjectId } from 'bson';
import { FastifyInstance, FastifyReply } from 'fastify';
import jwt from 'jsonwebtoken';
import { PrismaClientKnownRequestError } from '@prisma/client/runtime/library.js';

View File

@ -1,5 +1,5 @@
import type { Prisma } from '@prisma/client';
import { ObjectId } from 'mongodb';
import { ObjectId } from 'bson';
import { omit } from 'lodash-es';
import {
describe,

View File

@ -1,6 +1,6 @@
import { Experience, Portfolio } from '@prisma/client';
import { type FastifyPluginCallbackTypebox } from '@fastify/type-provider-typebox';
import { ObjectId } from 'mongodb';
import { ObjectId } from 'bson';
import { omit } from 'lodash-es';
import { isRestricted } from '../helpers/is-restricted.js';

View File

@ -1,4 +1,4 @@
import { ObjectId } from 'mongodb';
import { ObjectId } from 'bson';
// This is trivial, but makes it simple to refactor if we swap monogodb for
// bson, say.

View File

@ -128,6 +128,9 @@ importers:
ajv-formats:
specifier: 3.0.1
version: 3.0.1(ajv@8.20.0)
bson:
specifier: 7.2.0
version: 7.2.0
date-fns:
specifier: 4.1.0
version: 4.1.0
@ -158,9 +161,6 @@ importers:
lodash-es:
specifier: 4.18.1
version: 4.18.1
mongodb:
specifier: 6.21.0
version: 6.21.0(@aws-sdk/credential-providers@3.521.0)(socks@2.8.7)
nanoid:
specifier: '3'
version: 3.3.12