import DBShip from '../../types/db/DBShip';
import { Ships } from '../db/mongodb';

export const getAllShips = async () => {
    return (await Ships()).find({}).toArray() as unknown as Array<DBShip>;   
}

export const getResourceById = async (id: string) => {
    return (await Ships()).findOne({
        id
    }) as unknown as DBShip;
}