mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

Co-authored-by: Archer <545436317@qq.com> Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
16 lines
419 B
TypeScript
16 lines
419 B
TypeScript
import { connectionMongo, type Model } from '../../mongo';
|
|
const { Schema, model, models } = connectionMongo;
|
|
|
|
const FileSchema = new Schema({});
|
|
|
|
try {
|
|
FileSchema.index({ 'metadata.teamId': 1 });
|
|
FileSchema.index({ 'metadata.uploadDate': -1 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoFileSchema = models['dataset.files'] || model('dataset.files', FileSchema);
|
|
|
|
MongoFileSchema.syncIndexes();
|