1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var tslib_1 = require("tslib");
|
4 | var Repository_1 = require("./Repository");
|
5 |
|
6 |
|
7 |
|
8 | var MongoRepository = (function (_super) {
|
9 | tslib_1.__extends(MongoRepository, _super);
|
10 | function MongoRepository() {
|
11 | return _super !== null && _super.apply(this, arguments) || this;
|
12 | }
|
13 |
|
14 |
|
15 |
|
16 | |
17 |
|
18 |
|
19 |
|
20 | MongoRepository.prototype.query = function (query, parameters) {
|
21 | throw new Error("Queries aren't supported by MongoDB.");
|
22 | };
|
23 | |
24 |
|
25 |
|
26 |
|
27 | MongoRepository.prototype.createQueryBuilder = function (alias, queryRunner) {
|
28 | throw new Error("Query Builder is not supported by MongoDB.");
|
29 | };
|
30 | |
31 |
|
32 |
|
33 | MongoRepository.prototype.find = function (optionsOrConditions) {
|
34 | return this.manager.find(this.metadata.target, optionsOrConditions);
|
35 | };
|
36 | |
37 |
|
38 |
|
39 |
|
40 |
|
41 | MongoRepository.prototype.findAndCount = function (optionsOrConditions) {
|
42 | return this.manager.findAndCount(this.metadata.target, optionsOrConditions);
|
43 | };
|
44 | |
45 |
|
46 |
|
47 |
|
48 | MongoRepository.prototype.findByIds = function (ids, optionsOrConditions) {
|
49 | return this.manager.findByIds(this.metadata.target, ids, optionsOrConditions);
|
50 | };
|
51 | |
52 |
|
53 |
|
54 | MongoRepository.prototype.findOne = function (optionsOrConditions, maybeOptions) {
|
55 | return this.manager.findOne(this.metadata.target, optionsOrConditions, maybeOptions);
|
56 | };
|
57 | |
58 |
|
59 |
|
60 | MongoRepository.prototype.createCursor = function (query) {
|
61 | return this.manager.createCursor(this.metadata.target, query);
|
62 | };
|
63 | |
64 |
|
65 |
|
66 |
|
67 | MongoRepository.prototype.createEntityCursor = function (query) {
|
68 | return this.manager.createEntityCursor(this.metadata.target, query);
|
69 | };
|
70 | |
71 |
|
72 |
|
73 | MongoRepository.prototype.aggregate = function (pipeline, options) {
|
74 | return this.manager.aggregate(this.metadata.target, pipeline, options);
|
75 | };
|
76 | |
77 |
|
78 |
|
79 |
|
80 | MongoRepository.prototype.aggregateEntity = function (pipeline, options) {
|
81 | return this.manager.aggregateEntity(this.metadata.target, pipeline, options);
|
82 | };
|
83 | |
84 |
|
85 |
|
86 | MongoRepository.prototype.bulkWrite = function (operations, options) {
|
87 | return this.manager.bulkWrite(this.metadata.target, operations, options);
|
88 | };
|
89 | |
90 |
|
91 |
|
92 | MongoRepository.prototype.count = function (query, options) {
|
93 | return this.manager.count(this.metadata.target, query || {}, options);
|
94 | };
|
95 | |
96 |
|
97 |
|
98 | MongoRepository.prototype.createCollectionIndex = function (fieldOrSpec, options) {
|
99 | return this.manager.createCollectionIndex(this.metadata.target, fieldOrSpec, options);
|
100 | };
|
101 | |
102 |
|
103 |
|
104 |
|
105 |
|
106 | MongoRepository.prototype.createCollectionIndexes = function (indexSpecs) {
|
107 | return this.manager.createCollectionIndexes(this.metadata.target, indexSpecs);
|
108 | };
|
109 | |
110 |
|
111 |
|
112 | MongoRepository.prototype.deleteMany = function (query, options) {
|
113 | return this.manager.deleteMany(this.metadata.tableName, query, options);
|
114 | };
|
115 | |
116 |
|
117 |
|
118 | MongoRepository.prototype.deleteOne = function (query, options) {
|
119 | return this.manager.deleteOne(this.metadata.tableName, query, options);
|
120 | };
|
121 | |
122 |
|
123 |
|
124 | MongoRepository.prototype.distinct = function (key, query, options) {
|
125 | return this.manager.distinct(this.metadata.tableName, key, query, options);
|
126 | };
|
127 | |
128 |
|
129 |
|
130 | MongoRepository.prototype.dropCollectionIndex = function (indexName, options) {
|
131 | return this.manager.dropCollectionIndex(this.metadata.tableName, indexName, options);
|
132 | };
|
133 | |
134 |
|
135 |
|
136 | MongoRepository.prototype.dropCollectionIndexes = function () {
|
137 | return this.manager.dropCollectionIndexes(this.metadata.tableName);
|
138 | };
|
139 | |
140 |
|
141 |
|
142 | MongoRepository.prototype.findOneAndDelete = function (query, options) {
|
143 | return this.manager.findOneAndDelete(this.metadata.tableName, query, options);
|
144 | };
|
145 | |
146 |
|
147 |
|
148 | MongoRepository.prototype.findOneAndReplace = function (query, replacement, options) {
|
149 | return this.manager.findOneAndReplace(this.metadata.tableName, query, replacement, options);
|
150 | };
|
151 | |
152 |
|
153 |
|
154 | MongoRepository.prototype.findOneAndUpdate = function (query, update, options) {
|
155 | return this.manager.findOneAndUpdate(this.metadata.tableName, query, update, options);
|
156 | };
|
157 | |
158 |
|
159 |
|
160 | MongoRepository.prototype.geoHaystackSearch = function (x, y, options) {
|
161 | return this.manager.geoHaystackSearch(this.metadata.tableName, x, y, options);
|
162 | };
|
163 | |
164 |
|
165 |
|
166 | MongoRepository.prototype.geoNear = function (x, y, options) {
|
167 | return this.manager.geoNear(this.metadata.tableName, x, y, options);
|
168 | };
|
169 | |
170 |
|
171 |
|
172 | MongoRepository.prototype.group = function (keys, condition, initial, reduce, finalize, command, options) {
|
173 | return this.manager.group(this.metadata.tableName, keys, condition, initial, reduce, finalize, command, options);
|
174 | };
|
175 | |
176 |
|
177 |
|
178 | MongoRepository.prototype.collectionIndexes = function () {
|
179 | return this.manager.collectionIndexes(this.metadata.tableName);
|
180 | };
|
181 | |
182 |
|
183 |
|
184 | MongoRepository.prototype.collectionIndexExists = function (indexes) {
|
185 | return this.manager.collectionIndexExists(this.metadata.tableName, indexes);
|
186 | };
|
187 | |
188 |
|
189 |
|
190 | MongoRepository.prototype.collectionIndexInformation = function (options) {
|
191 | return this.manager.collectionIndexInformation(this.metadata.tableName, options);
|
192 | };
|
193 | |
194 |
|
195 |
|
196 | MongoRepository.prototype.initializeOrderedBulkOp = function (options) {
|
197 | return this.manager.initializeOrderedBulkOp(this.metadata.tableName, options);
|
198 | };
|
199 | |
200 |
|
201 |
|
202 | MongoRepository.prototype.initializeUnorderedBulkOp = function (options) {
|
203 | return this.manager.initializeUnorderedBulkOp(this.metadata.tableName, options);
|
204 | };
|
205 | |
206 |
|
207 |
|
208 | MongoRepository.prototype.insertMany = function (docs, options) {
|
209 | return this.manager.insertMany(this.metadata.tableName, docs, options);
|
210 | };
|
211 | |
212 |
|
213 |
|
214 | MongoRepository.prototype.insertOne = function (doc, options) {
|
215 | return this.manager.insertOne(this.metadata.tableName, doc, options);
|
216 | };
|
217 | |
218 |
|
219 |
|
220 | MongoRepository.prototype.isCapped = function () {
|
221 | return this.manager.isCapped(this.metadata.tableName);
|
222 | };
|
223 | |
224 |
|
225 |
|
226 | MongoRepository.prototype.listCollectionIndexes = function (options) {
|
227 | return this.manager.listCollectionIndexes(this.metadata.tableName, options);
|
228 | };
|
229 | |
230 |
|
231 |
|
232 | MongoRepository.prototype.mapReduce = function (map, reduce, options) {
|
233 | return this.manager.mapReduce(this.metadata.tableName, map, reduce, options);
|
234 | };
|
235 | |
236 |
|
237 |
|
238 |
|
239 | MongoRepository.prototype.parallelCollectionScan = function (options) {
|
240 | return this.manager.parallelCollectionScan(this.metadata.tableName, options);
|
241 | };
|
242 | |
243 |
|
244 |
|
245 | MongoRepository.prototype.reIndex = function () {
|
246 | return this.manager.reIndex(this.metadata.tableName);
|
247 | };
|
248 | |
249 |
|
250 |
|
251 | MongoRepository.prototype.rename = function (newName, options) {
|
252 | return this.manager.rename(this.metadata.tableName, newName, options);
|
253 | };
|
254 | |
255 |
|
256 |
|
257 | MongoRepository.prototype.replaceOne = function (query, doc, options) {
|
258 | return this.manager.replaceOne(this.metadata.tableName, query, doc, options);
|
259 | };
|
260 | |
261 |
|
262 |
|
263 | MongoRepository.prototype.stats = function (options) {
|
264 | return this.manager.stats(this.metadata.tableName, options);
|
265 | };
|
266 | |
267 |
|
268 |
|
269 | MongoRepository.prototype.updateMany = function (query, update, options) {
|
270 | return this.manager.updateMany(this.metadata.tableName, query, update, options);
|
271 | };
|
272 | |
273 |
|
274 |
|
275 | MongoRepository.prototype.updateOne = function (query, update, options) {
|
276 | return this.manager.updateOne(this.metadata.tableName, query, update, options);
|
277 | };
|
278 | return MongoRepository;
|
279 | }(Repository_1.Repository));
|
280 | exports.MongoRepository = MongoRepository;
|
281 |
|
282 |
|