Here is my model, closely following [the docs](https://mongoosejs.com/docs/5.x/docs/typescript.html) for mongoose v5.13.x with TypeScript:

```

import mongoose, { Model, Schema, Types } from "mongoose";

export interface Foo {
  label: string;

  archived: boolean;
  created_at: number;
  updated_at: number;
}

const FooSchema = new Schema<Foo, Model<Foo>, Foo>(
  {
    label: { type: String },

    archived: { type: Boolean, default: false },
  },
  {
    timestamps: {
      createdAt: "created_at",
      updatedAt: "updated_at",
      currentTime: () => Date.now() / 1000,
    },
  }
);

const Foo: Model<Foo> = mongoose.model<Foo>("Foo", FooSchema);

```

Ok, now I want functions to create and retrieve the model. When I create it, fields that are automatically created like `_id`, `archived`, `created_at`, and `updated_at` should all be optional. But when I retrieve it, they should all be available. For example:

```

type FooInput = {
  label: string;
};

type FooOutput = {
  _id: string;
  label: string;
  archived: boolean;
  created_at: number;
  updated_at: number;
};

export const createFoo = async (foo: FooInput): Promise<FooOutput> => {
  return await Foo.create(foo);
};

```

However, this throws type errors left and right; it'll say `_id` is optional in the output of `Foo.create()`, and if I add it to my type, `Foo.create(foo)` gets upset.

What is the correct way to type fields such as `_id`, `created_at`, etc in this case?