UNPKG

@chevre/domain

Version:

Chevre Domain Library for Node.js

20 lines (16 loc) 598 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 projectRepo = await chevre.repository.Project.createInstance(mongoose.connection); const result = await projectRepo.createById({ id: 'xxx', typeOf: chevre.factory.organizationType.Project }); // tslint:disable-next-line:no-null-keyword console.dir(result, { depth: null }); } main() .then(console.log) .catch(console.error);