|
|
@@ -0,0 +1,23 @@
|
|
|
+import type { Model, Document } from 'mongoose';
|
|
|
+import type mongoose from 'mongoose';
|
|
|
+import {
|
|
|
+ Schema,
|
|
|
+} from 'mongoose';
|
|
|
+
|
|
|
+import { getOrCreateModel } from '../util/mongoose-utils';
|
|
|
+
|
|
|
+type VectorStoreRelation = {
|
|
|
+ pageId: mongoose.Types.ObjectId;
|
|
|
+ fileId: string;
|
|
|
+}
|
|
|
+
|
|
|
+export interface VectorStoreRelationDocument extends VectorStoreRelation, Document {}
|
|
|
+
|
|
|
+export type VectorStoreRelationModel = Model<VectorStoreRelationDocument>
|
|
|
+
|
|
|
+const schema = new Schema<VectorStoreRelationDocument, VectorStoreRelationModel>({
|
|
|
+ pageId: { type: Schema.Types.ObjectId, ref: 'Page', required: true },
|
|
|
+ fileId: { type: String, required: true },
|
|
|
+});
|
|
|
+
|
|
|
+export default getOrCreateModel<VectorStoreRelationDocument, VectorStoreRelationModel>('VectorStoreRelation', schema);
|