🧮

MultiSelectProperty

💡
[P] means methods for Page Property, [D] means methods for Database Property.

1. Instance methods

[D] add_multi_select_option(name: a_name, color: a_color) → Hash

  • [PARAM] a_name new multi select name
  • [PARAM] a_color color of new multi select name
  1. add_multi_select_option of Page property raises StadndardError
  1. add_multi_select_option of Database property adds a multi-select option value of the database
    1. page.properties["MultiSelectTitle"].add_multi_select_option name: "a_name", color: "green" # => in `assert_database_property': add_multi_select_option can execute only Database property. (StandardError) db.properties["MultiSelectTitle"].add_multi_select_option name: "a_name", color: "green" # => # [{"id"=>"2a0eeeee-b3fd-4072-96a9-865f67cfa6ff", "name"=>"Multi Select 1", "color"=>"yellow"}, # {"id"=>"5f554552-b77a-474b-b5c7-4ae819966e32", "name"=>"Multi Select 2", "color"=>"default"}, # {"id"=>"d4bc3d6e-a6e1-4d57-af66-d8ecbbda1dd3", "name"=>"multi_select", "color"=>"red"}, # {"name"=>"a_name", "color"=>"green"}]

filter_contains(value) →
🎛️
Query

  • [PARAM] value value_for_filter
filter_contains creates a Query object for contains filter.
db.properties["CreatedByTitle"].filter_contains "a_user_id" # => #<NotionRubyMapping::Query:0x0000000110525498 @filter={"property"=>"CreatedByTitle", "created_by"=>{"contains"=>"a_user_id"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_contains "abc", condition: "any", another_type: "rich_text" # => #<NotionRubyMapping::Query:0x0000000105394f30 @filter={"property"=>"RollupTitle", "any"=>{"rich_text"=>{"contains"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_does_not_contain(value) →
🎛️
Query

  • [PARAM] value value_for_filter
filter_does_not_contain creates a Query object for does_not_contain filter.
db.properties["CreatedByTitle"].filter_does_not_contain "a_user_id" => #<NotionRubyMapping::Query:0x0000000110666b68 @filter={"property"=>"CreatedByTitle", "created_by"=>{"does_not_contain"=>"a_user_id"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["CreatedByTitle"].filter_does_not_contain "abc", condition: "every", another_type: "people" # => #<NotionRubyMapping::Query:0x000000010533e888 @filter={"property"=>"RollupTitle", "every"=>{"people"=>{"does_not_contain"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_is_empty →
🎛️
Query

filter_is_empty creates a Query object for is_empty filter.
db.properties["CreatedByTitle"].filter_is_empty => #<NotionRubyMapping::Query:0x0000000106af9ef0 @filter={"property"=>"CreatedByTitle", "created_by"=>{"is_empty"=>true}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_is_not_empty →
🎛️
Query

filter_is_not_empty creates a Query object for is_not_empty filter.
db.properties["CreatedByTitle"].filter_is_not_empty => #<NotionRubyMapping::Query:0x00000001104b7290 @filter={"property"=>"CreatedByTitle", "created_by"=>{"is_not_empty"=>true}}, @page_size=100, @sort=[], @start_cursor=nil>

multi_select → Array, Hash

  1. multi_select of Page property returns the array of multi-select property values of the page.
  1. multi_select of Database property returns hash with multi-select options values of the database.
    1. page.properties["MultiSelectTitle"].multi_select # => [{"id"=>"5f554552-b77a-474b-b5c7-4ae819966e32", "name"=>"Multi Select 2", "color"=>"default"}] db.properties["MultiSelectTitle"].multi_select # => # {"options"=> # [{"id"=>"2a0eeeee-b3fd-4072-96a9-865f67cfa6ff", "name"=>"Multi Select 1", "color"=>"yellow"}, # {"id"=>"5f554552-b77a-474b-b5c7-4ae819966e32", "name"=>"Multi Select 2", "color"=>"default"}, # {"id"=>"d4bc3d6e-a6e1-4d57-af66-d8ecbbda1dd3", "name"=>"multi_select", "color"=>"red"}]}

[P] multi_select=(multi_select)

  1. multi_select= of Page property sets muiti-select options
  1. multi_select= of Database property raise StandardError.
    1. pp = page.properties["MultiSelectTitle"] pp.multi_select = "Multi Select 3" pp.multi_select # => [{"name"=>"Multi Select 3"}] db.properties["MultiSelectTitle"].multi_select = ["Multi Select 3"] # => ...in `assert_page_property': multi_select= can execute only Page property. (StandardError)

multi_select_names → Array

  1. multi_select_names of Page property returns the array of multi-select names.
  1. multi_select_names of Database property returns the array of multi-select options names of the database.
    1. page.properties["MultiSelectTitle"].multi_select_names => ["Multi Select 2"] db.properties["MultiSelectTitle"].multi_select_names => ["Multi Select 1", "Multi Select 2", "multi_select"]

[D] multi_select_options → Array

  1. multi_select_options of Page property raises StandardError
  1. multi_select_options of Database property returns multi-select options values of the database
    1. page.properties["MultiSelectTitle"].multi_select_options # => in `assert_database_property': multi_select_options can execute only Database property. (StandardError) db.properties["MultiSelectTitle"].multi_select_options # => # [{"id"=>"2a0eeeee-b3fd-4072-96a9-865f67cfa6ff", "name"=>"Multi Select 1", "color"=>"yellow"}, # {"id"=>"5f554552-b77a-474b-b5c7-4ae819966e32", "name"=>"Multi Select 2", "color"=>"default"}, # {"id"=>"d4bc3d6e-a6e1-4d57-af66-d8ecbbda1dd3", "name"=>"multi_select", "color"=>"red"}]