@@ -92,7 +92,7 @@ def allow_partial_results
92
92
#
93
93
# @since 2.0.0
94
94
def batch_size ( batch_size = nil )
95
- configure ( __method__ , batch_size )
95
+ configure ( :batch_size , batch_size )
96
96
end
97
97
98
98
# Associate a comment with the query.
@@ -110,7 +110,7 @@ def batch_size(batch_size = nil)
110
110
#
111
111
# @since 2.0.0
112
112
def comment ( comment = nil )
113
- configure_modifier ( __method__ , comment )
113
+ configure_modifier ( :comment , comment )
114
114
end
115
115
116
116
# Get a count of matching documents in the collection.
@@ -178,7 +178,7 @@ def distinct(field_name, options={})
178
178
#
179
179
# @since 2.0.0
180
180
def hint ( hint = nil )
181
- configure_modifier ( __method__ , hint )
181
+ configure_modifier ( :hint , hint )
182
182
end
183
183
184
184
# The max number of docs to return from the query.
@@ -192,7 +192,7 @@ def hint(hint = nil)
192
192
#
193
193
# @since 2.0.0
194
194
def limit ( limit = nil )
195
- configure ( __method__ , limit )
195
+ configure ( :limit , limit )
196
196
end
197
197
198
198
# Execute a map/reduce operation on the collection view.
@@ -222,7 +222,7 @@ def map_reduce(map, reduce, options = {})
222
222
#
223
223
# @since 2.0.0
224
224
def max_scan ( value = nil )
225
- configure_modifier ( __method__ , value )
225
+ configure_modifier ( :max_scan , value )
226
226
end
227
227
228
228
# Set the maximum value to search.
@@ -236,7 +236,7 @@ def max_scan(value = nil)
236
236
#
237
237
# @since 2.1.0
238
238
def max_value ( value = nil )
239
- configure_modifier ( __method__ , value )
239
+ configure_modifier ( :max_value , value )
240
240
end
241
241
242
242
# Set the minimum value to search.
@@ -250,7 +250,7 @@ def max_value(value = nil)
250
250
#
251
251
# @since 2.1.0
252
252
def min_value ( value = nil )
253
- configure_modifier ( __method__ , value )
253
+ configure_modifier ( :min_value , value )
254
254
end
255
255
256
256
# The server normally times out idle cursors after an inactivity period
@@ -263,7 +263,7 @@ def min_value(value = nil)
263
263
#
264
264
# @since 2.0.0
265
265
def no_cursor_timeout
266
- configure_flag ( __method__ )
266
+ configure_flag ( :no_cursor_timeout )
267
267
end
268
268
269
269
# The fields to include or exclude from each doc in the result set.
@@ -282,7 +282,7 @@ def no_cursor_timeout
282
282
# @since 2.0.0
283
283
def projection ( document = nil )
284
284
validate_doc! ( document ) if document
285
- configure ( __method__ , document )
285
+ configure ( :projection , document )
286
286
end
287
287
288
288
# The read preference to use for the query.
@@ -298,7 +298,7 @@ def projection(document = nil)
298
298
# @since 2.0.0
299
299
def read ( value = nil )
300
300
return default_read if value . nil?
301
- configure ( __method__ , value . is_a? ( Hash ) ? ServerSelector . get ( value ) : value )
301
+ configure ( :read , value . is_a? ( Hash ) ? ServerSelector . get ( value ) : value )
302
302
end
303
303
304
304
# Set whether to return only the indexed field or fields.
@@ -312,7 +312,7 @@ def read(value = nil)
312
312
#
313
313
# @since 2.1.0
314
314
def return_key ( value = nil )
315
- configure_modifier ( __method__ , value )
315
+ configure_modifier ( :return_key , value )
316
316
end
317
317
318
318
# Set whether the disk location should be shown for each document.
@@ -327,7 +327,7 @@ def return_key(value = nil)
327
327
#
328
328
# @since 2.0.0
329
329
def show_disk_loc ( value = nil )
330
- configure_modifier ( __method__ , value )
330
+ configure_modifier ( :show_disk_loc , value )
331
331
end
332
332
333
333
# The number of docs to skip before returning results.
@@ -342,7 +342,7 @@ def show_disk_loc(value = nil)
342
342
#
343
343
# @since 2.0.0
344
344
def skip ( number = nil )
345
- configure ( __method__ , number )
345
+ configure ( :skip , number )
346
346
end
347
347
348
348
# Set the snapshot value for the view.
@@ -357,7 +357,7 @@ def skip(number = nil)
357
357
#
358
358
# @since 2.0.0
359
359
def snapshot ( value = nil )
360
- configure_modifier ( __method__ , value )
360
+ configure_modifier ( :snapshot , value )
361
361
end
362
362
363
363
# The key and direction pairs by which the result set will be sorted.
@@ -372,7 +372,7 @@ def snapshot(value = nil)
372
372
#
373
373
# @since 2.0.0
374
374
def sort ( spec = nil )
375
- configure_modifier ( __method__ , spec )
375
+ configure_modifier ( :sort , spec )
376
376
end
377
377
378
378
# “meta” operators that let you modify the output or behavior of a query.
@@ -387,7 +387,7 @@ def sort(spec = nil)
387
387
# @since 2.1.0
388
388
def modifiers ( doc = nil )
389
389
return @modifiers if doc . nil?
390
- new ( options . merge ( __method__ => doc ) )
390
+ new ( options . merge ( :modifiers => doc ) )
391
391
end
392
392
393
393
# A cumulative time limit in milliseconds for processing operations on a cursor.
@@ -401,7 +401,7 @@ def modifiers(doc = nil)
401
401
#
402
402
# @since 2.1.0
403
403
def max_time_ms ( max = nil )
404
- configure_modifier ( __method__ , max )
404
+ configure_modifier ( :max_time_ms , max )
405
405
end
406
406
407
407
private
0 commit comments