Class: Exwiw::MongoQuery::Find
- Inherits:
-
Struct
- Object
- Struct
- Exwiw::MongoQuery::Find
- Defined in:
- lib/exwiw/mongo_query.rb
Overview
timeout_ms is the per-collection, server-enforced operation timeout (CSOT)
applied when this query runs; nil falls back to the client-wide global
(ConnectionConfig#mongodb_query_timeout_ms) or, if that is also unset, no
timeout. Omitted from #to_h when nil so the historical 4-key query shape is
unchanged for collections without a timeout.
Instance Attribute Summary collapse
-
#collection ⇒ Object
Returns the value of attribute collection.
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
-
#projection ⇒ Object
Returns the value of attribute projection.
-
#timeout_ms ⇒ Object
Returns the value of attribute timeout_ms.
Instance Method Summary collapse
Instance Attribute Details
#collection ⇒ Object
Returns the value of attribute collection
10 11 12 |
# File 'lib/exwiw/mongo_query.rb', line 10 def collection @collection end |
#filter ⇒ Object
Returns the value of attribute filter
10 11 12 |
# File 'lib/exwiw/mongo_query.rb', line 10 def filter @filter end |
#primary_key ⇒ Object
Returns the value of attribute primary_key
10 11 12 |
# File 'lib/exwiw/mongo_query.rb', line 10 def primary_key @primary_key end |
#projection ⇒ Object
Returns the value of attribute projection
10 11 12 |
# File 'lib/exwiw/mongo_query.rb', line 10 def projection @projection end |
#timeout_ms ⇒ Object
Returns the value of attribute timeout_ms
10 11 12 |
# File 'lib/exwiw/mongo_query.rb', line 10 def timeout_ms @timeout_ms end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/exwiw/mongo_query.rb', line 11 def to_h { collection: collection, primary_key: primary_key, filter: filter, projection: projection, }.tap { |h| h[:timeout_ms] = timeout_ms unless timeout_ms.nil? } end |