import { Db } from 'mongodb' ; import { BaseModel } from './BaseModel' ; export async function initDocument ( model , db , collectionName ) { model . _id = ( await db . collection ( collectionName ) . insertOne ( { } ) ) . insertedId as any ; }