@chevre/domain
Version:
Chevre Domain Library for Node.js
24 lines (17 loc) • 654 B
text/typescript
// tslint:disable:no-console
import * as mongoose from 'mongoose';
import { chevre } from '../../../lib/index';
const project = { id: String(process.env.PROJECT_ID) };
async function main() {
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
const offerCatalogRepo = await chevre.repository.OfferCatalog.createInstance(mongoose.connection);
const result = await offerCatalogRepo.findItemListElementById({
id: 'blpc770py',
project: { id: project.id }
});
console.log(result);
console.log(result.itemListElement.length);
}
main()
.then(console.log)
.catch(console.error);