🧮

FormulaProperty

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

1. Instance methods

filter_after(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_after creates a Query object for after filter.
> db.created_time.filter_after Time.new(2022, 5, 4, 21, 30) # => #<NotionRubyMapping::Query:0x000000011058def8 @filter={"timestamp"=>"created_time", "created_time"=>{"after"=>"2022-05-04T21:30:00+09:00"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty db.properties["RollupTitle"].filter_after Date.new(2022, 5, 7), another_type: "date" # => #<NotionRubyMapping::Query:0x0000000109241f58 @filter={"property"=>"RollupTitle", "date"=>{"after"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_before(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_before creates a Query object for before filter.
db.created_time.filter_before Time.new(2022, 5, 4, 21, 30) # => #<NotionRubyMapping::Query:0x0000000110675cf8 @filter={"timestamp"=>"created_time", "created_time"=>{"before"=>"2022-05-04T21:30:00+09:00"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_before Date.new(2022, 5, 7), another_type: "date" # => #<NotionRubyMapping::Query:0x00000001055804e8 @filter={"property"=>"RollupTitle", "date"=>{"before"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil>

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_does_not_equal(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_does_not_equal creates a Query object for does_not_equal filter.
db.properties["CheckboxTitle"].filter_does_not_equal true # => #<NotionRubyMapping::Query:0x0000000110487680 @filter={"property"=>"CheckboxTitle", "checkbox"=>{"does_not_equal"=>true}}, @page_size=100, @sort=[], @start_cursor=nil> db.created_time.filter_does_not_equal Date.new(2022, 5, 4) # => #<NotionRubyMapping::Query:0x000000011052c928 @filter={"timestamp"=>"created_time", "created_time"=>{"does_not_equal"=>"2022-05-04"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_does_not_equal "abc", condition: "every", another_type: "phone_number" # => #<NotionRubyMapping::Query:0x00000001090d5430 @filter={"property"=>"RollupTitle", "every"=>{"phone_number"=>{"does_not_equal"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_does_not_equal Date.new(2022, 5, 7), another_type: "date" # => #<NotionRubyMapping::Query:0x00000001090ff668 @filter={"property"=>"RollupTitle", "date"=>{"does_not_equal"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (number) db.properties["RollupTitle"].filter_does_not_equal 100, another_type: "number" # => #<NotionRubyMapping::Query:0x00000001090dc7f8 @filter={"property"=>"RollupTitle", "number"=>{"does_not_equal"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_ends_with(str) →
🎛️
Query

filter_ends_with(str) creates a Query object for ends_with filter.
db.properties["MailTitle"].filter_ends_with "ac.jp" => #<NotionRubyMapping::Query:0x0000000105281b48 @filter={"property"=>"MailTitle", "email"=>{"ends_with"=>"ac.jp"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_ends_with "abc", condition: "none", another_type: "rich_text" # => #<NotionRubyMapping::Query:0x00000001054d9558 @filter={"property"=>"RollupTitle", "none"=>{"rich_text"=>{"ends_with"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_equals(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_equals creates a Query object for equals filter.
db.properties["CheckboxTitle"].filter_equals true # => #<NotionRubyMapping::Query:0x00000001105279f0 @filter={"property"=>"CheckboxTitle", "checkbox"=>{"equals"=>true}}, @page_size=100, @sort=[], @start_cursor=nil> db.created_time.filter_equals Date.new(2022, 5, 4) # => #<NotionRubyMapping::Query:0x000000011046dd20 @filter={"timestamp"=>"created_time", "created_time"=>{"equals"=>"2022-05-04"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_equals "abc", condition: "every", another_type: "phone_number" # => #<NotionRubyMapping::Query:0x0000000109033928 @filter={"property"=>"RollupTitle", "every"=>{"phone_number"=>{"equals"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_equals Date.new(2022, 5, 7), another_type: "date" # => #<NotionRubyMapping::Query:0x000000010925b480 @filter={"property"=>"RollupTitle", "date"=>{"equals"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (number) db.properties["RollupTitle"].filter_equals 100, another_type: "number" # => #<NotionRubyMapping::Query:0x0000000108f5f0b0 @filter={"property"=>"RollupTitle", "number"=>{"equals"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_greater_than(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_greater_than creates a Query object for greater_than filter.
db.properties["NumberTitle"].filter_greater_than 10 # => #<NotionRubyMapping::Query:0x0000000106bddf88 @filter={"property"=>"NumberTitle", "number"=>{"greater_than"=>10}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (number) db.properties["RollupTitle"].filter_greater_than 100, another_type: "number" # => #<NotionRubyMapping::Query:0x0000000108f550b0 @filter={"property"=>"RollupTitle", "number"=>{"greater_than"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_greater_than_or_equal_to(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_greater_than_or_equal_to creates a Query object for greater_than_or_equal_to filter.
db.properties["NumberTitle"].filter_greater_than_or_equal_to 10 # => #<NotionRubyMapping::Query:0x00000001055a7e30 @filter={"property"=>"NumberTitle", "number"=>{"greater_than_or_equal_to"=>10}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (number) db.properties["RollupTitle"].filter_greater_than_or_equal_to 100, another_type: "number" # => #<NotionRubyMapping::Query:0x0000000108f564b0 @filter={"property"=>"RollupTitle", "number"=>{"greater_than_or_equal_to"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_less_than(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_less_than creates a Query object for less_than filter.
db.properties["NumberTitle"].filter_less_than 100 # => #<NotionRubyMapping::Query:0x0000000105143e70 @filter={"property"=>"NumberTitle", "number"=>{"less_than"=>100}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (number) db.properties["RollupTitle"].filter_less_than 100, another_type: "number" # => #<NotionRubyMapping::Query:0x00000001093b17f8 @filter={"property"=>"RollupTitle", "number"=>{"less_than"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_less_than_or_equal_to(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_less_than_or_equal_to creates a Query object for less_than_or_equal_to filter.
db.properties["NumberTitle"].filter_less_than_or_equal_to 100 # => #<NotionRubyMapping::Query:0x0000000106b7e740 @filter={"property"=>"NumberTitle", "number"=>{"less_than_or_equal_to"=>100}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (number) db.properties["RollupTitle"].filter_less_than_or_equal_to 100, another_type: "number" # => #<NotionRubyMapping::Query:0x0000000108f247a8 @filter={"property"=>"RollupTitle", "number"=>{"less_than_or_equal_to"=>100}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_on_or_after(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_on_or_after creates a Query object for on_or_after filter.
db.created_time.filter_on_or_after Time.new(2022, 5, 4, 21, 30) # => #<NotionRubyMapping::Query:0x0000000110557880 @filter={"timestamp"=>"created_time", "created_time"=>{"on_or_after"=>"2022-05-04T21:30:00+09:00"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_on_or_after Date.new(2022, 5, 7), another_type: "date" # => #<NotionRubyMapping::Query:0x0000000109378598 @filter={"property"=>"RollupTitle", "date"=>{"on_or_after"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_on_or_before(value) →
🎛️
Query

  • [PARAM] value value for filter
filter_on_or_before creates a Query object for on_or_before filter.
db.created_time.filter_on_or_before Time.new(2022, 5, 4, 21, 30) # => #<NotionRubyMapping::Query:0x0000000106e65f58 @filter={"timestamp"=>"created_time", "created_time"=>{"on_or_before"=>"2022-05-04T21:30:00+09:00"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_on_or_before Date.new(2022, 5, 7), another_type: "date" # => #<NotionRubyMapping::Query:0x00000001090a9ec0 @filter={"property"=>"RollupTitle", "date"=>{"on_or_before"=>"2022-05-07"}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_next_month →
🎛️
Query

filter_next_month creates a Query object for next_month filter.
db.created_time.filter_next_month => #<NotionRubyMapping::Query:0x000000011040fea0 @filter={"timestamp"=>"created_time", "created_time"=>{"next_month"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_next_week →
🎛️
Query

filter_next_week creates a Query object for next_week filter.
db.created_time.filter_next_week # => #<NotionRubyMapping::Query:0x000000011053f2a8 @filter={"timestamp"=>"created_time", "created_time"=>{"next_week"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_next_week another_type: "date" # => #<NotionRubyMapping::Query:0x00000001093497c0 @filter={"property"=>"RollupTitle", "date"=>{"next_week"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_next_year →
🎛️
Query

filter_next_year creates a Query object for next_year filter.
db.created_time.filter_next_year # => #<NotionRubyMapping::Query:0x000000011061cef0 @filter={"timestamp"=>"created_time", "created_time"=>{"next_year"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_next_year another_type: "date" # => #<NotionRubyMapping::Query:0x0000000109370b68 @filter={"property"=>"RollupTitle", "date"=>{"next_year"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_past_month →
🎛️
Query

filter_past_month creates a Query object for past_month filter.
db.created_time.filter_past_month # => #<NotionRubyMapping::Query:0x0000000106861940 @filter={"timestamp"=>"created_time", "created_time"=>{"past_month"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_past_month another_type: "date" # => #<NotionRubyMapping::Query:0x0000000108ffb848 @filter={"property"=>"RollupTitle", "date"=>{"past_month"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_past_week →
🎛️
Query

filter_past_week creates a Query object for past_week filter.
db.created_time.filter_past_week => #<NotionRubyMapping::Query:0x000000010699aac8 @filter={"timestamp"=>"created_time", "created_time"=>{"past_week"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_past_week another_type: "date" # => #<NotionRubyMapping::Query:0x00000001090dd2e8 @filter={"property"=>"RollupTitle", "date"=>{"past_week"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_past_year →
🎛️
Query

filter_past_year creates a Query object for past_year filter.
db.created_time.filter_past_year => #<NotionRubyMapping::Query:0x0000000110276a80 @filter={"timestamp"=>"created_time", "created_time"=>{"past_year"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (date) db.properties["RollupTitle"].filter_past_year another_type: "date" # => #<NotionRubyMapping::Query:0x0000000109258118 @filter={"property"=>"RollupTitle", "date"=>{"past_year"=>{}}}, @page_size=100, @sort=[], @start_cursor=nil>

filter_starts_with(str) →
🎛️
Query

filter_starts_with(str) creates a Query object for starts_with filter.
db.properties["MailTitle"].filter_starts_with "hkob" => #<NotionRubyMapping::Query:0x0000000101377218 @filter={"property"=>"MailTitle", "email"=>{"starts_with"=>"hkob"}}, @page_size=100, @sort=[], @start_cursor=nil> ### only RollupProperty (none, any, every) db.properties["RollupTitle"].filter_starts_with "abc", condition: "none", another_type: "rich_text" => #<NotionRubyMapping::Query:0x0000000105523c70 @filter={"property"=>"RollupTitle", "none"=>{"rich_text"=>{"starts_with"=>"abc"}}}, @page_size=100, @sort=[], @start_cursor=nil>

formula → Hash

  1. formula of Page property returns the calculated value by formula expression.
  1. formula of Database property returns the settled formula expression.
    1. page.properties["FormulaTitle"].formula # => {"type"=>"date", "date"=>{"start"=>"2022-05-05T02:55:00.000+00:00", "end"=>nil, "time_zone"=>nil}} db.properties["FormulaTitle"].formula # => {"expression"=>"now()"}

[D] formula_expressoin → String, Hash

  1. formula_expression of Page property raises StandardError.
  1. formula_expression of Database property returns an empty Hash {}.
    1. page.properties["FormulaTitle"].formula_expression # ...:in `assert_page_property': email= can execute only Database property. (StandardError) db.properties["FormulaTitle"].formula_expression # => "now()"

[D] formula_expressoin=(value)

  • [PARAM] value new email address value
  1. formula_expression=(value) of Page property raises StandardError..
  1. formula_expression=(value) of Database property sets the formula expression value and set will_update_flag to true.
    1. db.properties["FormulaTitle"].formula_expression = " # ...:in `assert_page_property': email= can execute only Database property. (StandardError) db.properties["FormulaTitle"].formula_expression = "now()" => "now()"