UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

17 lines (13 loc) 577 B
// tslint:disable:no-console import * as mongoose from 'mongoose'; import { chevre } from '../../../lib/index'; async function main() { await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false }); const reservationRepo = await chevre.repository.Reservation.createInstance(mongoose.connection); const ids = await reservationRepo.searchIdsByReservationNumber({ reservationNumber: { $in: ['283297254100608'] } }); console.log(ids); console.log(ids.length, 'reservations found'); } main() .then(console.log) .catch(console.error);