improve README

This commit is contained in:
2016-11-18 00:59:57 +01:00
parent 90d9a25b3f
commit 0b8adea736
4 changed files with 15 additions and 8 deletions

View File

@ -3,10 +3,10 @@ import * as plugins from './smartdata.plugins'
import { Db } from './smartdata.classes.db'
import { DbCollection } from './smartdata.classes.dbcollection'
export type TDocCreation = 'db' | 'data' | 'mixed'
export type TDocCreation = 'db' | 'new' | 'mixed'
/**
* sva - saveable decorator to be used on class properties
* saveable - saveable decorator to be used on class properties
*/
export function saveable(target: DbDoc<any>, key: string) {
console.log('called sva')
@ -47,6 +47,13 @@ export class DbDoc<T> {
for (let propertyNameString of this.saveableProperties) {
saveableObject[propertyNameString] = this[propertyNameString]
}
switch (this.creationType) {
case 'db':
this.collection // TODO implement collection.update()
break
case 'new':
this.collection.insertOne(saveableObject)
}
}
/**