cgserver 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,8 +35,8 @@ class BaseService {
|
|
|
35
35
|
let rs = await MongoManager_1.GMongoMgr.findOne(this._table, proterty, where, sort);
|
|
36
36
|
return rs.one;
|
|
37
37
|
}
|
|
38
|
-
async
|
|
39
|
-
let rs = await MongoManager_1.GMongoMgr.
|
|
38
|
+
async countDocuments(where, options) {
|
|
39
|
+
let rs = await MongoManager_1.GMongoMgr.countDocuments(this._table, where);
|
|
40
40
|
return rs.count;
|
|
41
41
|
}
|
|
42
42
|
async gets(property, where, sort, skip = 0, limit = 0) {
|
|
@@ -176,7 +176,7 @@ class MongoManager {
|
|
|
176
176
|
rs.list = list;
|
|
177
177
|
return rs;
|
|
178
178
|
}
|
|
179
|
-
async
|
|
179
|
+
async countDocuments(collection, where, options) {
|
|
180
180
|
this._convertWhere(where);
|
|
181
181
|
let rs = { errcode: null, count: -1 };
|
|
182
182
|
if (!this._mongo) {
|
|
@@ -18,7 +18,7 @@ export declare class BaseService<T> {
|
|
|
18
18
|
*/
|
|
19
19
|
getById(id: any): Promise<any>;
|
|
20
20
|
get(proterty?: {}, where?: {}, sort?: {}): Promise<any>;
|
|
21
|
-
|
|
21
|
+
countDocuments(where?: {}, options?: mongo.CountDocumentsOptions): Promise<number>;
|
|
22
22
|
gets(property?: {}, where?: {}, sort?: {}, skip?: number, limit?: number): Promise<any[]>;
|
|
23
23
|
getRandoms(num: number, proterty?: {}, where?: {}): Promise<any[]>;
|
|
24
24
|
updateOne(model: any, where?: {}, upsert?: boolean): Promise<{
|
|
@@ -62,7 +62,7 @@ declare class MongoManager {
|
|
|
62
62
|
};
|
|
63
63
|
list: any[];
|
|
64
64
|
}>;
|
|
65
|
-
|
|
65
|
+
countDocuments(collection: string, where?: {}, options?: mongo.CountDocumentsOptions): Promise<{
|
|
66
66
|
errcode: {
|
|
67
67
|
id: number;
|
|
68
68
|
des: string;
|