Describe the bug
The problem is from "orca/packages/orca-api/src/db/messages.ts"
Typescript fails to compile, gives this error:
Value of type 'typeof ObjectId' is not callable. Did you mean to include 'new'?ts(2348)
System
Node.js version: 16.8.0
Example
// CODE SNIPPET FROM: "orca/packages/orca-api/src/db/messages.ts"
import mongoose from 'mongoose';
import { Message, User } from '../models';
Describe the bug The problem is from "orca/packages/orca-api/src/db/messages.ts" Typescript fails to compile, gives this error: Value of type 'typeof ObjectId' is not callable. Did you mean to include 'new'?ts(2348)
System Node.js version: 16.8.0
Example // CODE SNIPPET FROM: "orca/packages/orca-api/src/db/messages.ts"
import mongoose from 'mongoose'; import { Message, User } from '../models';
export const getConversations = async (authUserId: string): Promise => {
const lastConversations = await Message.aggregate([
{
$match: {
$or: [
{
receiver: mongoose.Types.ObjectId(authUserId),
},
{
sender: mongoose.Types.ObjectId(authUserId),
},
],
},
},