Chat system with mongodb

I am trying to create a simple chat system using mongodb and next js but im running into error
below is my code

import { connectDB } from “@/app/lib/database”
import Chat from “@/app/models/chat”
import { NextResponse } from “next/server”

export async function POST(req){

const { postOwner, userId, username, message, senderId} = await req.json()
    await connectDB()

      const chat = await Chat.findOne({members:{$all:[postOwner, userId]}})
      
      if(!chat){
         chat.create(
            {members:[userId, postOwner]},
            {chat:[{username, message, senderId}]})
      console.log(chat)
      return NextResponse.json({message:'Chat Created', chat}, {status:200})
      }else{
        console.log(chat)
        chat.insertOne(
            {chat:[{username, message, senderId}]})
           
        return NextResponse.json({message:'Chat added', chat}, {status:200}) 
      }}

and here is my mondel

import mongoose, {Schema, models} from “mongoose”;

const chatSchema = new Schema({
members: {
userId:String,
postOwner:String
},
chat:{
username:String,
message:String,
senderId:String
}
},
{timestamps:true})

const Chat = models.Chat || mongoose.model(“Chat”, chatSchema)
export default Chat

here is my error

⨯ TypeError: chat.insertOne is not a function
at POST (webpack-internal:///(rsc)/./app/api/chat/route.js:46:14)

please what am i doing wrong