<aside> đ Links (Property base class)
Notion Ruby Mapping Public API Reference
</aside>
<aside> âšī¸ â Table of Contents
</aside>
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_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_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
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>
status
of Page property returns the status property value of the page.
status
of Database property returns hash with status options values of the database.
page.properties["StatusTitle"].status
# => => {"id"=>"F<XA", "name"=>"Design", "color"=>"purple"}
db.properties["StatusTitle"].select
# =>
# {"options"=>
# [{"id"=>"dfd8a326-f149-4b01-b01a-57d8aed6de1b",
# "name"=>"Not started",
# "color"=>"default"},
# {"id"=>"f17767fd-3186-4ba2-8d3a-01eef36e88ec",
# "name"=>"In progress",
# "color"=>"blue"},
# {"id"=>"F<XA", "name"=>"Design", "color"=>"purple"},
# {"id"=>"IRXI", "name"=>"Implementation", "color"=>"orange"},
# {"id"=>"ceb89388-7f74-4bd5-a52d-0fd572a409f6",
# "name"=>"Done",
# "color"=>"green"}],
# "groups"=>
# [{"id"=>"2b356467-0400-420c-ad91-cdd5f98fc799",
# "name"=>"To-do",
# "color"=>"gray",
# "option_ids"=>["dfd8a326-f149-4b01-b01a-57d8aed6de1b"]},
# {"id"=>"ff88fa16-34b6-4818-ae5c-f8ce892d888b",
# "name"=>"In progress",
# "color"=>"blue",
# "option_ids"=>["IRXI", "f17767fd-3186-4ba2-8d3a-01eef36e88ec", "F<XA"]},
# {"id"=>"de6040ae-17d1-4dc7-939c-b7db49bcf482",
# "name"=>"Complete",
# "color"=>"green",
# "option_ids"=>["ceb89388-7f74-4bd5-a52d-0fd572a409f6"]}]}
status=(status)
of Page property sets the select property value of the page
status=(status)
of Database property raise StandardError
pp = page.properties["StatusTitle"]
pp.status = "Implementation"
pp.status
# => {"name"=>"Implementation"}
db.properties["StatusTitle"].status = "Implementation"
# => ... in `assert_page_property': status= can execute only Page property. (StandardError)