import * as smartdata from '@pushrocks/smartdata'; let db: smartdata.SmartdataDb; export const stop = async () => { await db.close(); } export const generateTestData = async (mongoDescriptorArg: smartdata.IMongoDescriptor) => { db = new smartdata.SmartdataDb(mongoDescriptorArg); await db.init(); let counter = 0; @smartdata.Collection(db) class House extends smartdata.SmartDataDbDoc { @smartdata.unI() id = `hello-${counter}`; @smartdata.svDb() data = { 'some' : { 'complex': 'structure', more: 4 } } } @smartdata.Collection(db) class Truck extends smartdata.SmartDataDbDoc { @smartdata.unI() id = `hello-${counter}`; @smartdata.svDb() data = { 'some' : { 'complex': 'structure', more: 2 } } } while (counter < 100) { const house = new House(); await house.save(); const truck = new Truck(); await truck.save(); counter++; } }