Skip to content

Commit 8a8c570

Browse files
committed
[UCMS-11864] Add hint argument to Fish0::Repository
1 parent 5dd25af commit 8a8c570

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Fish0 0.2.2 (May, 06, 2023) ##
2+
3+
* Added `hint` argument to `Fish0::Repository` in order to force usage of specific index(-es).
4+
5+
16
## Fish0 0.2.0 (June, 01, 2017) ##
27

38
* `config.mongo_hosts` -> `config.mongo_uri`. Now it accepts both Mongo URI as string and Hosts as array.

lib/fish0/repository.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ def skip(value)
8787
self
8888
end
8989

90+
def hint(value)
91+
@hint = value
92+
self
93+
end
94+
9095
def scope(name, body)
9196
return if respond_to?(name)
9297

@@ -105,6 +110,7 @@ def fetch
105110
scoped = scoped.projection(@projection) if @projection
106111
scoped = scoped.skip(skip_quantity) if skip_quantity.positive?
107112
scoped = scoped.limit(limit_quantity) if limit_quantity.positive?
113+
scoped = scoped.hint(@hint) if @hint
108114
scoped
109115
end
110116

lib/fish0/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Fish0
2-
VERSION = '0.2.1'.freeze
2+
VERSION = '0.2.2'.freeze
33
end

0 commit comments

Comments
 (0)