feat(SmartdataDoc): add custom unique indexes

This commit is contained in:
2018-07-10 21:27:16 +02:00
parent 1cf02157c4
commit 46514a2743
5 changed files with 562 additions and 1 deletions

View File

@ -7,6 +7,7 @@ let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit/');
// the tested module
import * as smartdata from '../ts';
import { smartstring } from '../ts/smartdata.plugins';
import * as shortid from 'shortid';
// =======================================
// Connecting to the database server
@ -32,6 +33,7 @@ tap.test('should establish a connection to the rethink Db cluster', async () =>
@smartdata.Collection(testDb)
class Car extends smartdata.SmartDataDbDoc<Car> {
@smartdata.unI() index: string = shortid();
@smartdata.svDb() color: string;
@smartdata.svDb() brand: string;
constructor(colorArg: string, brandArg: string) {