Indexes
Indexes( [database] )
Indexes( )
ScopedIndexes( database )
Indexes( [database] )
Indexes( [database] )
indexes( [database] )
Indexes( [database] )
Description
The Indexes
function, when executed with Paginate
, returns an
array of References for all indexes in the specified child database
.
If a child database
is not specified, the returned index references
all belong to the current database.
When a child Also, Go does not support optional function parameters, nor function
overloading. To specify a child |
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Optional - A Reference to a child database. If not specified, the current database is used. A Reference to a child database. Optional - A Reference to a child database. If not specified, the current database is used. Optional - A Reference to a child database. If not specified, the current database is used. Optional - A Reference to a child database. If not specified, the current database is used. Optional - A Reference to a child database. If not specified, the current database is used. Optional - A Reference to a child database. If not specified, the current database is used. |
Examples
-
The following query lists the References for any indexes (up to the pagination limit) in the current database:
ObjectV(data: Arr(RefV(id = "spells_by_element", collection = RefV(id = "indexes")), RefV(id = "spellbooks_by_owner", collection = RefV(id = "indexes")), RefV(id = "spells_by_spellbook", collection = RefV(id = "indexes")), RefV(id = "spells_by_element_and_name", collection = RefV(id = "indexes")), RefV(id = "elements_of_spells", collection = RefV(id = "indexes")), RefV(id = "letters", collection = RefV(id = "indexes")), RefV(id = "people_by_age_first", collection = RefV(id = "indexes")), RefV(id = "people_by_last_first", collection = RefV(id = "indexes")), RefV(id = "users_by_email", collection = RefV(id = "indexes")), RefV(id = "products_by_customer", collection = RefV(id = "indexes")), RefV(id = "products_by_store", collection = RefV(id = "indexes")), RefV(id = "inventory_by_product", collection = RefV(id = "indexes")), RefV(id = "products_by_price_high_to_low", collection = RefV(id = "indexes")), RefV(id = "products_by_price_low_to_high", collection = RefV(id = "indexes")), RefV(id = "all_customers", collection = RefV(id = "indexes")), RefV(id = "all_orders", collection = RefV(id = "indexes")), RefV(id = "all_products", collection = RefV(id = "indexes")), RefV(id = "all_stores", collection = RefV(id = "indexes"))))
map[data:[{spells_by_element 0xc00008f410 0xc00008f410 <nil>} {spellbooks_by_owner 0xc00008f500 0xc00008f500 <nil>} {spells_by_spellbook 0xc00008f5f0 0xc00008f5f0 <nil>} {spells_by_element_and_name 0xc00008f6e0 0xc00008f6e0 <nil>} {elements_of_spells 0xc00008f7d0 0xc00008f7d0 <nil>} {letters 0xc00008f8c0 0xc00008f8c0 <nil>} {people_by_age_first 0xc000136030 0xc000136030 <nil>} {people_by_last_first 0xc000136120 0xc000136120 <nil>} {users_by_email 0xc000136210 0xc000136210 <nil>} {products_by_customer 0xc000136300 0xc000136300 <nil>} {products_by_store 0xc0001363f0 0xc0001363f0 <nil>} {inventory_by_product 0xc0001364e0 0xc0001364e0 <nil>} {products_by_price_high_to_low 0xc0001365d0 0xc0001365d0 <nil>} {products_by_price_low_to_high 0xc0001366c0 0xc0001366c0 <nil>} {all_customers 0xc0001367b0 0xc0001367b0 <nil>} {all_orders 0xc0001368a0 0xc0001368a0 <nil>} {all_products 0xc000136990 0xc000136990 <nil>} {all_stores 0xc000136a80 0xc000136a80 <nil>}]]
{data: [ref(id = "spells_by_element", collection = ref(id = "indexes")), ref(id = "spellbooks_by_owner", collection = ref(id = "indexes")), ref(id = "spells_by_spellbook", collection = ref(id = "indexes")), ref(id = "spells_by_element_and_name", collection = ref(id = "indexes")), ref(id = "elements_of_spells", collection = ref(id = "indexes")), ref(id = "letters", collection = ref(id = "indexes")), ref(id = "people_by_age_first", collection = ref(id = "indexes")), ref(id = "people_by_last_first", collection = ref(id = "indexes")), ref(id = "users_by_email", collection = ref(id = "indexes")), ref(id = "products_by_customer", collection = ref(id = "indexes")), ref(id = "products_by_store", collection = ref(id = "indexes")), ref(id = "inventory_by_product", collection = ref(id = "indexes")), ref(id = "products_by_price_high_to_low", collection = ref(id = "indexes")), ref(id = "products_by_price_low_to_high", collection = ref(id = "indexes")), ref(id = "all_customers", collection = ref(id = "indexes")), ref(id = "all_orders", collection = ref(id = "indexes")), ref(id = "all_products", collection = ref(id = "indexes")), ref(id = "all_stores", collection = ref(id = "indexes"))]}
{ data: [ Index("spells_by_element"), Index("spellbooks_by_owner"), Index("spells_by_spellbook"), Index("spells_by_element_and_name"), Index("elements_of_spells"), Index("letters"), Index("people_by_age_first"), Index("people_by_last_first"), Index("users_by_email"), Index("products_by_customer"), Index("products_by_store"), Index("inventory_by_product"), Index("products_by_price_high_to_low"), Index("products_by_price_low_to_high"), Index("all_customers"), Index("all_orders"), Index("all_products"), Index("all_stores") ] }
{'data': [Ref(id=spells_by_element, collection=Ref(id=indexes)), Ref(id=spellbooks_by_owner, collection=Ref(id=indexes)), Ref(id=spells_by_spellbook, collection=Ref(id=indexes)), Ref(id=spells_by_element_and_name, collection=Ref(id=indexes)), Ref(id=elements_of_spells, collection=Ref(id=indexes)), Ref(id=letters, collection=Ref(id=indexes)), Ref(id=people_by_age_first, collection=Ref(id=indexes)), Ref(id=people_by_last_first, collection=Ref(id=indexes)), Ref(id=users_by_email, collection=Ref(id=indexes)), Ref(id=products_by_customer, collection=Ref(id=indexes)), Ref(id=products_by_store, collection=Ref(id=indexes)), Ref(id=inventory_by_product, collection=Ref(id=indexes)), Ref(id=products_by_price_high_to_low, collection=Ref(id=indexes)), Ref(id=products_by_price_low_to_high, collection=Ref(id=indexes)), Ref(id=all_customers, collection=Ref(id=indexes)), Ref(id=all_orders, collection=Ref(id=indexes)), Ref(id=all_products, collection=Ref(id=indexes)), Ref(id=all_stores, collection=Ref(id=indexes))]}
{ data: [ Index("spells_by_element"), Index("spellbooks_by_owner"), Index("spells_by_spellbook"), Index("spells_by_element_and_name"), Index("elements_of_spells"), Index("letters"), Index("people_by_age_first"), Index("people_by_last_first"), Index("users_by_email"), Index("products_by_customer"), Index("products_by_store"), Index("inventory_by_product"), Index("products_by_price_high_to_low"), Index("products_by_price_low_to_high"), Index("all_customers"), Index("all_orders"), Index("all_products"), Index("all_stores") ] }
-
The following query lists the References for any indexes (up to the pagination limit) in a child database named "child_db":
ObjectV(data: Arr())
map[data:[]]
{data: []}
{ data: [] }
{'data': []}
{ data: [] }
-
The following query demonstrates what happens when no indexes exist:
ObjectV(data: Arr())
map[data:[]]
{data: []}
{ data: [] }
{'data': []}
{ data: [] }
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!