mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
- Refactored model creation functions to enhance clarity and consistency across the data-schemas. - Introduced createModels and createMethods functions to streamline the instantiation of Mongoose models and methods. - Updated test-role.js to utilize the new createModels and createMethods for better organization.
13 lines
433 B
JavaScript
13 lines
433 B
JavaScript
require('dotenv').config({ path: '../.env' });
|
|
const mongoose = require('mongoose');
|
|
const connect = require('../config/connect');
|
|
const { createModels, createMethods } = require('@librechat/data-schemas');
|
|
createModels(mongoose);
|
|
const { listRoles } = createMethods(mongoose);
|
|
|
|
(async () => {
|
|
await connect();
|
|
console.log('Connected to database');
|
|
const roles = await listRoles();
|
|
console.dir(roles, { depth: null });
|
|
})();
|