def get_random_oids(collection, sample_size: int) -> list:
    """Returns a random sample of oids from the mongoengine collection

    :param collection: collection to get oids for
    :param sample_size: number of oids to generate
    :return: list of random oids
    """
    pipeline = [{"$project": {"_id": 1}}, {"$sample": {"size": sample_size}}]
    return [s["_id"] for s in collection.aggregate(pipeline)]