-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathnode.js
More file actions
128 lines (105 loc) · 2.55 KB
/
node.js
File metadata and controls
128 lines (105 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
'use strict';
/**
* Module dependencies
*/
const Collection = require('./collection');
class NodeCollection extends Collection {
constructor(col) {
super();
this.collection = col;
this.collectionName = col.collectionName;
}
/**
* find(match, options)
*/
async find(match, options) {
const cursor = this.collection.find(match, options);
return cursor.toArray();
}
/**
* findOne(match, options)
*/
async findOne(match, options) {
return this.collection.findOne(match, options);
}
/**
* countDocuments(match, options)
*/
async countDocuments(match, options) {
return this.collection.countDocuments(match, options);
}
/**
* estimatedDocumentCount(match, options)
*/
async estimatedDocumentCount(match, options) {
return this.collection.estimatedDocumentCount(match, options);
}
/**
* distinct(prop, match, options)
*/
async distinct(prop, match, options) {
return this.collection.distinct(prop, match, options);
}
/**
* updateMany(match, update, options)
*/
async updateMany(match, update, options) {
return this.collection.updateMany(match, update, options);
}
/**
* updateOne(match, update, options)
*/
async updateOne(match, update, options) {
return this.collection.updateOne(match, update, options);
}
/**
* replaceOne(match, update, options)
*/
async replaceOne(match, update, options) {
return this.collection.replaceOne(match, update, options);
}
/**
* deleteOne(match, options)
*/
async deleteOne(match, options) {
return this.collection.deleteOne(match, options);
}
/**
* deleteMany(match, options)
*/
async deleteMany(match, options) {
return this.collection.deleteMany(match, options);
}
/**
* findOneAndDelete(match, options, function(err[, result])
*/
async findOneAndDelete(match, options) {
return this.collection.findOneAndDelete(match, options);
}
/**
* findOneAndUpdate(match, update, options)
*/
async findOneAndUpdate(match, update, options) {
return this.collection.findOneAndUpdate(match, update, options);
}
/**
* findOneAndReplace(match, update, options)
*/
async findOneAndReplace(match, update, options) {
return this.collection.findOneAndReplace(match, update, options);
}
/**
* var cursor = findCursor(match, options)
*/
findCursor(match, options) {
return this.collection.find(match, options);
}
/**
* aggregation(operators...)
* TODO
*/
}
/**
* Expose
*/
module.exports = exports = NodeCollection;