// tslint:disable:no-console // import * as redis from 'redis'; import * as mongoose from 'mongoose'; import { chevre } from '../../../lib/index'; async function main() { await mongoose.connect(process.env.MONGOLAB_URI); const offerRepo = new chevre.repository.Offer(mongoose.connection); const offers = await offerRepo.search({ limit: 1, page: 1, project: { id: { $eq: String(process.env.PROJECT_ID) } }, eligibleSeatingType: { codeValue: { $eq: 'Premium' } }, priceSpecification: { // appliesToMovieTicket: { // serviceType: { $eq: '01' }, // serviceOutput: { // typeOf: { $eq: 'MovieTicket' } // } // } } }); console.log(offers); console.log(offers.length); } main() .then(console.log) .catch(console.error);