Method: Contentstack::Query#not_contained_in
- Defined in:
- lib/contentstack/query.rb
permalink #not_contained_in(field_uid, values) ⇒ Contentstack::Query Also known as: not_in
Add a constraint to the query that requires a particular key entry’s value not be contained in the provided array.
Example 1 - Array Not-equals Operator Within Group
@query = @stack.content_type('category').query
@query.not_contained_in("title", ["Electronics", "Apparel"])
Example 2 - Array Not-equals Operator Within Modular Blocks
@query = @stack.content_type('category').query
@query.not_contained_in("additional_info.deals.deal_name", ["Christmas Deal", "Summer Deal"])
280 281 282 283 |
# File 'lib/contentstack/query.rb', line 280 def not_contained_in(field_uid, values) add_query_hash({:"#{field_uid}" => {"$nin" => values}}) self end |