UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

25 lines (19 loc) 714 B
// 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 ownershipInfoRepo = await chevre.repository.OwnershipInfo.createInstance(mongoose.connection); const result = await ownershipInfoRepo.projectFieldsById( { id: 'd9080760-1bdb-49cf-86eb-50f98fab0010' } // ['id', 'typeOfGood'] ); // tslint:disable-next-line:no-null-keyword console.dir(result, { depth: null }); } main() .then(console.log) .catch(console.error);