fix: updateById error
This commit is contained in:
parent
eef5226ac3
commit
034a43b2e8
22
packages/cc-server-core/.npmignore
Normal file
22
packages/cc-server-core/.npmignore
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
src
|
||||||
|
test
|
||||||
|
typings
|
||||||
|
bundled
|
||||||
|
build
|
||||||
|
coverage
|
||||||
|
docs
|
||||||
|
wiki
|
||||||
|
gulpfile.js
|
||||||
|
bower.json
|
||||||
|
karma.conf.js
|
||||||
|
tsconfig.json
|
||||||
|
typings.json
|
||||||
|
CONTRIBUTING.md
|
||||||
|
ISSUE_TEMPLATE.md
|
||||||
|
PULL_REQUEST_TEMPLATE.md
|
||||||
|
tslint.json
|
||||||
|
wallaby.js
|
||||||
|
.travis.yml
|
||||||
|
.gitignore
|
||||||
|
.vscode
|
||||||
|
type_definitions
|
@ -20,6 +20,7 @@
|
|||||||
"cc-server-ioc": "^0.2.2",
|
"cc-server-ioc": "^0.2.2",
|
||||||
"inversify": "^5.0.1",
|
"inversify": "^5.0.1",
|
||||||
"inversify-express-utils": "^6.3.2",
|
"inversify-express-utils": "^6.3.2",
|
||||||
|
"prettyjson": "^1.2.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"typescript": "^3.5.1"
|
"typescript": "^3.5.1"
|
||||||
},
|
},
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import 'reflect-metadata';
|
import 'reflect-metadata';
|
||||||
import { InversifyExpressServer } from 'inversify-express-utils';
|
import { InversifyExpressServer, getRouteInfo } from 'inversify-express-utils';
|
||||||
import * as bodyParser from 'body-parser';
|
import * as bodyParser from 'body-parser';
|
||||||
import { container, buildProviderModule } from 'cc-server-ioc';
|
import { container, buildProviderModule } from 'cc-server-ioc';
|
||||||
|
import * as prettyjson from "prettyjson";
|
||||||
|
|
||||||
import './function/handle';
|
import './function/handle';
|
||||||
|
|
||||||
@ -19,6 +20,11 @@ server.setConfig((app) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
let serverInstance = server.build();
|
let serverInstance = server.build();
|
||||||
|
|
||||||
|
const routeInfo = getRouteInfo(container);
|
||||||
|
|
||||||
|
console.log(prettyjson.render({ routes: routeInfo }));
|
||||||
|
|
||||||
serverInstance.listen(80);
|
serverInstance.listen(80);
|
||||||
|
|
||||||
console.log('Server started on port 80 :)');
|
console.log('Server started on port 80 :)');
|
||||||
|
22
packages/cc-server-db-mongo/.npmignore
Normal file
22
packages/cc-server-db-mongo/.npmignore
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
src
|
||||||
|
test
|
||||||
|
typings
|
||||||
|
bundled
|
||||||
|
build
|
||||||
|
coverage
|
||||||
|
docs
|
||||||
|
wiki
|
||||||
|
gulpfile.js
|
||||||
|
bower.json
|
||||||
|
karma.conf.js
|
||||||
|
tsconfig.json
|
||||||
|
typings.json
|
||||||
|
CONTRIBUTING.md
|
||||||
|
ISSUE_TEMPLATE.md
|
||||||
|
PULL_REQUEST_TEMPLATE.md
|
||||||
|
tslint.json
|
||||||
|
wallaby.js
|
||||||
|
.travis.yml
|
||||||
|
.gitignore
|
||||||
|
.vscode
|
||||||
|
type_definitions
|
@ -53,7 +53,7 @@ export class MongoDBClient<T = any> implements DBClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async updateById(objectId: string, model: any): Promise<boolean> {
|
public async updateById(objectId: string, model: any): Promise<boolean> {
|
||||||
return await this.updateOne({ _id: new ObjectID(objectId) }, { $set: model })
|
return await this.updateOne({ _id: new ObjectID(objectId) }, model)
|
||||||
}
|
}
|
||||||
|
|
||||||
public async deleteOne(where: any): Promise<boolean> {
|
public async deleteOne(where: any): Promise<boolean> {
|
||||||
|
22
packages/cc-server-db/.npmignore
Normal file
22
packages/cc-server-db/.npmignore
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
src
|
||||||
|
test
|
||||||
|
typings
|
||||||
|
bundled
|
||||||
|
build
|
||||||
|
coverage
|
||||||
|
docs
|
||||||
|
wiki
|
||||||
|
gulpfile.js
|
||||||
|
bower.json
|
||||||
|
karma.conf.js
|
||||||
|
tsconfig.json
|
||||||
|
typings.json
|
||||||
|
CONTRIBUTING.md
|
||||||
|
ISSUE_TEMPLATE.md
|
||||||
|
PULL_REQUEST_TEMPLATE.md
|
||||||
|
tslint.json
|
||||||
|
wallaby.js
|
||||||
|
.travis.yml
|
||||||
|
.gitignore
|
||||||
|
.vscode
|
||||||
|
type_definitions
|
22
packages/cc-server-ioc/.npmignore
Normal file
22
packages/cc-server-ioc/.npmignore
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
src
|
||||||
|
test
|
||||||
|
typings
|
||||||
|
bundled
|
||||||
|
build
|
||||||
|
coverage
|
||||||
|
docs
|
||||||
|
wiki
|
||||||
|
gulpfile.js
|
||||||
|
bower.json
|
||||||
|
karma.conf.js
|
||||||
|
tsconfig.json
|
||||||
|
typings.json
|
||||||
|
CONTRIBUTING.md
|
||||||
|
ISSUE_TEMPLATE.md
|
||||||
|
PULL_REQUEST_TEMPLATE.md
|
||||||
|
tslint.json
|
||||||
|
wallaby.js
|
||||||
|
.travis.yml
|
||||||
|
.gitignore
|
||||||
|
.vscode
|
||||||
|
type_definitions
|
Loading…
Reference in New Issue
Block a user