mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 03:10:15 +01:00
WIP: first pass, factory models and methods
This commit is contained in:
parent
a2a3f5c044
commit
c201d54cac
6 changed files with 67 additions and 105 deletions
|
|
@ -1,10 +1,13 @@
|
|||
require('dotenv').config({ path: '../.env' });
|
||||
const mongoose = require('mongoose');
|
||||
const connect = require('../config/connect');
|
||||
const { Role } = require('@librechat/data-schemas');
|
||||
const { createRoleMethods, createRoleModel } = require('@librechat/data-schemas');
|
||||
createRoleModel(mongoose);
|
||||
const { listRoles } = createRoleMethods(mongoose);
|
||||
|
||||
(async () => {
|
||||
await connect();
|
||||
console.log('Connected to database');
|
||||
const role = await Role.findOne({ name: 'ADMIN' });
|
||||
console.log(role);
|
||||
})();
|
||||
const roles = await listRoles();
|
||||
console.dir(roles, { depth: null });
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue