1
1
package org .scalajs .nodejs .mongodb
2
2
3
- import org .scalajs .nodejs .mongodb .Cursor .CursorFlag
4
3
import org .scalajs .nodejs
4
+ import org .scalajs .nodejs .mongodb .Cursor .CursorFlag
5
5
6
6
import scala .scalajs .js
7
+ import scala .scalajs .js .|
7
8
8
9
/**
9
10
* Cursor
@@ -27,13 +28,6 @@ trait Cursor extends nodejs.stream.Readable {
27
28
*/
28
29
def addQueryModifier (name : String , value : js.Any ): this .type = js.native
29
30
30
- /**
31
- * Sets the batch size parameter of this cursor to the given value.
32
- * @param batchSize the new batch size.
33
- * @example batchSize(batchSize[, callback])
34
- */
35
- def batchSize (batchSize : Int ): this .type = js.native
36
-
37
31
/**
38
32
* Sets the batch size parameter of this cursor to the given value.
39
33
* @param batchSize the new batch size.
@@ -43,7 +37,7 @@ trait Cursor extends nodejs.stream.Readable {
43
37
* execution.
44
38
* @example batchSize(batchSize[, callback])
45
39
*/
46
- def batchSize (batchSize : Int , callback : js.Function ): this .type = js.native
40
+ def batchSize (batchSize : Int , callback : js.Function = js.native ): this .type = js.native
47
41
48
42
/**
49
43
* Clone the cursor
@@ -110,26 +104,14 @@ trait Cursor extends nodejs.stream.Readable {
110
104
* Set the cursor hint
111
105
* @param hint If specified, then the query system will only consider plans using the hinted index.
112
106
*/
113
- def hint (hint : String ): this .type = js.native
114
-
115
- /**
116
- * Set the cursor hint
117
- */
118
- def hint (): this .type = js.native
107
+ def hint (hint : String = js.native): this .type = js.native
119
108
120
109
/**
121
110
* Check if the cursor is closed or open.
122
111
* @return the state of the cursor.
123
112
*/
124
113
def isClosed (): Boolean = js.native
125
114
126
- /**
127
- * Sets the limit parameter of this cursor to the given value.
128
- * @param limit the new limit.
129
- * @example limit(limit[, callback])
130
- */
131
- def limit (limit : Int ): this .type = js.native
132
-
133
115
/**
134
116
* Sets the limit parameter of this cursor to the given value.
135
117
* @param limit the new limit.
@@ -138,7 +120,7 @@ trait Cursor extends nodejs.stream.Readable {
138
120
* closed while the second parameter will contain a reference to this object upon successful execution.
139
121
* @example limit(limit[, callback])
140
122
*/
141
- def limit (limit : Int , callback : js.Function ): this .type = js.native
123
+ def limit (limit : Int , callback : js.Function = js.native ): this .type = js.native
142
124
143
125
/**
144
126
* Map all documents using the provided function
@@ -176,15 +158,7 @@ trait Cursor extends nodejs.stream.Readable {
176
158
* successful execution.
177
159
* @example maxTimeMS(maxTimeMS[, callback])
178
160
*/
179
- def maxTimeMS (maxTimeMS : Int , callback : js.Function ): this .type = js.native
180
-
181
- /**
182
- * Specifies a time limit for a query operation. After the specified time is exceeded, the operation will be
183
- * aborted and an error will be returned to the client. If maxTimeMS is null, no limit is applied.
184
- * @param maxTimeMS the maxTimeMS for the query.
185
- * @example maxTimeMS(maxTimeMS[, callback])
186
- */
187
- def maxTimeMS (maxTimeMS : Int ): this .type = js.native
161
+ def maxTimeMS (maxTimeMS : Int , callback : js.Function = js.native): this .type = js.native
188
162
189
163
/**
190
164
* Set the cursor min
@@ -241,14 +215,6 @@ trait Cursor extends nodejs.stream.Readable {
241
215
*/
242
216
def rewind (): this .type = js.native
243
217
244
- /**
245
- * Sets the read preference for the cursor
246
- * @param pref read preference for the cursor, one of [[ServerClass.READ_PRIMARY Server.READ_PRIMARY ]],
247
- * [[ServerClass.READ_SECONDARY Server.READ_SECONDARY ]], [[ServerClass.READ_SECONDARY Server.READ_SECONDARY_ONLY ]]
248
- * @example setReadPreference(pref[, callback])
249
- */
250
- def setReadPreference (pref : String ): this .type = js.native
251
-
252
218
/**
253
219
* Sets the read preference for the cursor
254
220
* @param pref read preference for the cursor, one of [[ServerClass.READ_PRIMARY Server.READ_PRIMARY ]],
@@ -259,7 +225,7 @@ trait Cursor extends nodejs.stream.Readable {
259
225
* successful execution.
260
226
* @example setReadPreference(pref[, callback])
261
227
*/
262
- def setReadPreference (pref : String , callback : js.Function ): this .type = js.native
228
+ def setReadPreference (pref : String , callback : js.Function = js.native ): this .type = js.native
263
229
264
230
/**
265
231
* Set the cursor showRecordId
@@ -276,14 +242,7 @@ trait Cursor extends nodejs.stream.Readable {
276
242
* while the second parameter will contain a reference to this object upon successful execution.
277
243
* @example skip(skip[, callback])
278
244
*/
279
- def skip (skip : Int , callback : js.Function ): this .type = js.native
280
-
281
- /**
282
- * Sets the skip parameter of this cursor to the given value.
283
- * @param skip the new skip value.
284
- * @example skip(skip[, callback])
285
- */
286
- def skip (skip : Int ): this .type = js.native
245
+ def skip (skip : Int , callback : js.Function = js.native): this .type = js.native
287
246
288
247
/**
289
248
* Sets the sort parameter of this cursor to the given value.
@@ -298,30 +257,25 @@ trait Cursor extends nodejs.stream.Readable {
298
257
* to this object upon successful execution.
299
258
* @example sort(keyOrList, direction, callback)
300
259
*/
301
- def sort (keyOrList : js.Array [js. Any ] , direction : Int , callback : js.Function ): this .type = js.native
260
+ def sort (keyOrList : js.Any , direction : Int | String , callback : js.Function ): this .type = js.native
302
261
303
262
/**
304
263
* Sets the sort parameter of this cursor to the given value.
305
264
* @param keyOrList this can be a string or an array. If passed as a string, the string will be the field to sort.
306
265
* If passed an array, each element will represent a field to be sorted and should be an array that
307
266
* contains the format [string, direction].
308
- * @param direction this determines how the results are sorted. "asc", "ascending" or 1 for
309
- * ascending order while "desc", "desceding or -1 for descending order.
310
- * <b>Note</b> that the strings are case insensitive.
311
267
* @param callback this will be called after executing this method. The first parameter will contain an error
312
268
* object when the cursor is already closed while the second parameter will contain a reference
313
269
* to this object upon successful execution.
314
- * @example sort(keyOrList, direction, callback)
270
+ * @example sort(keyOrList, callback)
315
271
*/
316
- def sort (keyOrList : js.Array [js. Any ], direction : String , callback : js.Function ): this .type = js.native
272
+ def sort (keyOrList : js.Any , callback : js.Function = js.native ): this .type = js.native
317
273
318
274
/**
319
- * Sets the sort parameter of this cursor to the given value.
320
- * @param keyOrList this can be a string or an array. If passed as a string, the string will be the field to sort.
321
- * @example sort(keyOrList, direction, callback)
275
+ * TODO document me
276
+ * @param enable
277
+ * @return
322
278
*/
323
- def sort (keyOrList : js.Array [js.Any ]): this .type = js.native
324
-
325
279
def snapshot (enable : Boolean ): this .type = js.native
326
280
327
281
/**
0 commit comments