fix mongodb startup
This commit is contained in:
parent
715709f3ec
commit
b45e7ee206
2
dist/smartdata.classes.dbdoc.d.ts
vendored
2
dist/smartdata.classes.dbdoc.d.ts
vendored
@ -1,7 +1,7 @@
|
||||
import { DbCollection } from './smartdata.classes.dbcollection';
|
||||
export declare type TDocCreation = 'db' | 'new' | 'mixed';
|
||||
/**
|
||||
* sva - saveable decorator to be used on class properties
|
||||
* saveable - saveable decorator to be used on class properties
|
||||
*/
|
||||
export declare function saveable(target: DbDoc<any>, key: string): void;
|
||||
export declare class DbDoc<T> {
|
||||
|
11
dist/smartdata.classes.dbdoc.js
vendored
11
dist/smartdata.classes.dbdoc.js
vendored
@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
/**
|
||||
* sva - saveable decorator to be used on class properties
|
||||
* saveable - saveable decorator to be used on class properties
|
||||
*/
|
||||
function saveable(target, key) {
|
||||
console.log('called sva');
|
||||
@ -26,6 +26,13 @@ class DbDoc {
|
||||
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);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* also store any referenced objects to DB
|
||||
@ -36,4 +43,4 @@ class DbDoc {
|
||||
}
|
||||
}
|
||||
exports.DbDoc = DbDoc;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRkYXRhLmNsYXNzZXMuZGJkb2MuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGRhdGEuY2xhc3Nlcy5kYmRvYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBT0E7O0dBRUc7QUFDSCxrQkFBeUIsTUFBa0IsRUFBRSxHQUFXO0lBQ3BELE9BQU8sQ0FBQyxHQUFHLENB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7 +23,7 @@ describe('mongodb', function () {
|
||||
this.timeout(30000)
|
||||
mongoChildProcess = shelljs.exec('mongod --dbpath=./test/data --port 27017', { async: true, silent: true })
|
||||
let doneCalled = false
|
||||
mongoChildProcess.stdout.on('new', function (data) {
|
||||
mongoChildProcess.stdout.on('data', function (data) {
|
||||
console.log(smartstring.indent.indentWithPrefix(data, '*** MongoDB Process *** : '))
|
||||
if (!doneCalled) {
|
||||
if (/waiting for connections on port 27017/.test(data)) {
|
||||
|
Loading…
Reference in New Issue
Block a user