// tslint:disable:no-console import * as moment from 'moment'; import * as mongoose from 'mongoose'; import { chevre } from '../../../lib/index'; const project = { id: process.env.PROJECT_ID }; async function main() { await mongoose.connect(process.env.MONGOLAB_URI); // const now = new Date(); await chevre.service.aggregation.project.aggregate({ project: { id: project.id }, reservationFor: { startFrom: moment('2022-01-01T00:00:00+09:00') .toDate(), startThrough: moment('2022-01-31T23:59:59+09:00') .toDate(), } })({ project: new chevre.repository.Project(mongoose.connection), reservation: new chevre.repository.Reservation(mongoose.connection), task: new chevre.repository.Task(mongoose.connection) }); } main() .then(() => { console.log('success!'); }) .catch(console.error);