fix(core): update
This commit is contained in:
32
test/sampledata.ts
Normal file
32
test/sampledata.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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<House, House> {
|
||||
@smartdata.unI()
|
||||
id = `hello-${counter}`;
|
||||
|
||||
@smartdata.svDb()
|
||||
data = {
|
||||
'some' : {
|
||||
'complex': 'structure'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while (counter < 100) {
|
||||
const house = new House();
|
||||
await house.save();
|
||||
counter++;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user