fix(core): update

This commit is contained in:
2021-11-12 16:23:26 +01:00
parent 9b3892c1e8
commit 551916fe5c
4 changed files with 155 additions and 38 deletions

View File

@ -200,14 +200,19 @@ class Truck extends smartdata.SmartDataDbDoc<Car, Car> {
tap.test('should store a new Truck', async () => {
const truck = new Truck('blue', 'MAN');
await truck.save();
const myTruck = await Truck.getInstance({ color: 'blue' });
myTruck.id = 'foo';
await myTruck.save();
const myTruck2 = await Truck.getInstance({ color: 'blue' });
console.log(myTruck2);
myTruck2.color = 'red';
await myTruck2.save();
const myTruck3 = await Truck.getInstance({ color: 'blue' });
console.log(myTruck3);
});
tap.test('should ', async () => {});
tap.test('should use a cursor', async () => {
const cursor = await Truck.getCursor({});
cursor.forEach(async truckArg => {
console.log(truckArg.id);
});
});
// =======================================
// close the database connection