import DBStructure from '../../types/db/DBStructure';
import { Structures } from '../db/mongodb';

export const getAllStructures = async () => {
    return (await Structures()).find({}).toArray() as unknown as Array<DBStructure>;
}

export const getStructureById = async (id: string) => {
    return (await Structures()).findOne({
        id
    }) as unknown as DBStructure;
}