order()

将结果与指定的 column 排序.

const { data, error } = await supabase
  .from('cities')
  .select('name', 'country_id')
  .order('id', { ascending: false })

Parameters

  • column required object

    根据 "列 "来排序.
  • __namedParameters required object

    No description provided.
      Properties
    • nullsFirst required boolean

      如果 "true","null "会先出现.
    • foreignTable required undefined | string

      要使用的外域表(如果`column`是一个外域列).
    • ascending required boolean

      如果`true`,结果将按升序排列.

    Examples

    使用select()

    const { data, error } = await supabase
      .from('cities')
      .select('name', 'country_id')
      .order('id', { ascending: false })
    

    带有嵌入式资源

    const { data, error } = await supabase
      .from('countries')
      .select('name, cities(name)')
      .eq('name', 'United States')
      .order('name', {foreignTable: 'cities'})
    

results matching ""

    No results matching ""