import { ObjectId } from "mongodb";
import { Galaxies } from "./mongodb"
import DBGalaxy from "../../types/db/DBGalaxy";

export const getAllGalaxies = async () => {
    return await (await Galaxies()).find({}).toArray() as DBGalaxy[];
}

export const getGalaxyById = async (id: ObjectId) => {
    return await (await Galaxies()).findOne({
        _id: id
    }) as DBGalaxy;
}