INNER CODE UNIT · TypeScript

find

austin-starks/Promptimizer · src/models/context/index.ts:78

  static async find() {
    const userContexts = await ContextModel.find({})
      .sort({ _id: -1 })
      .exec()
      .then((models) => models.map((model) => new Context(model)));
    const sharedContexts = [
      new Context({
        name: "dateContext",
        value: new Date().toISOString(),
      }),
    ];
    return [...sharedContexts, ...userContexts];
  }
}
export default Context;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…