cgserver 8.9.0 → 8.9.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,9 +35,6 @@ class MongoBaseService {
|
|
|
35
35
|
return rs.one;
|
|
36
36
|
}
|
|
37
37
|
async get(property, where) {
|
|
38
|
-
if (property) {
|
|
39
|
-
property = { projection: property };
|
|
40
|
-
}
|
|
41
38
|
let rs = await MongoManager_1.GMongoMgr.findOne(this._table, property, where);
|
|
42
39
|
return rs.one;
|
|
43
40
|
}
|
|
@@ -46,16 +43,10 @@ class MongoBaseService {
|
|
|
46
43
|
return rs.count;
|
|
47
44
|
}
|
|
48
45
|
async gets(property, where, sort, skip = 0, limit = 0) {
|
|
49
|
-
if (property) {
|
|
50
|
-
property = { projection: property };
|
|
51
|
-
}
|
|
52
46
|
let rs = await MongoManager_1.GMongoMgr.findMany(this._table, property, where, sort, skip, limit);
|
|
53
47
|
return rs.list;
|
|
54
48
|
}
|
|
55
49
|
async getRandoms(num, property, where) {
|
|
56
|
-
if (property) {
|
|
57
|
-
property = { projection: property };
|
|
58
|
-
}
|
|
59
50
|
let rs = await MongoManager_1.GMongoMgr.simpleAggregate(this._table, property, where, null, num);
|
|
60
51
|
return rs.list;
|
|
61
52
|
}
|
|
@@ -175,7 +175,7 @@ class MongoManager {
|
|
|
175
175
|
let list = [];
|
|
176
176
|
try {
|
|
177
177
|
let col = this._mongoDb.collection(collection);
|
|
178
|
-
let cursor = col.find(where, property);
|
|
178
|
+
let cursor = col.find(where, { projection: property });
|
|
179
179
|
if (sort) {
|
|
180
180
|
cursor = cursor.sort(sort);
|
|
181
181
|
}
|