Keys

Keys( [database] )
Keys( [database] )
Keys( [database] )
Keys( [database] )
keys( [database] )
keys [database]
Keys( [database] )
Keys( [database] )

Description

The Keys function, when executed with Paginate, returns an array of References for authentication keys associated with the specified child database. If a child database is not specified, the returned key references all belong to the current database.

When a child database is specified, an admin key must be used to call Keys (server or client keys, or ABAC tokens, cannot be used to access a child database).

Parameters

Argument Type Definition and Requirements

database

Optional - A reference to a child database. If not specified, the current database is used.

Returns

A Set reference for the available authentication keys in the specified child database (or the current database if database is not specified).

Examples

The following query gets the references to all keys in the current database:

client.Query(Paginate(Keys()));
result, _ := client.Query(f.Paginate(f.Keys()))

fmt.Println(result)
System.out.println(
    client.query(
        Paginate(Keys())
    ).get());
client.query(
  q.Paginate(q.Keys())
)
.then((ret) => console.log(ret))
print(client.query(
  q.paginate(q.keys())
)
Not available in this language yet.
println(Await.result(
  client.query(
    Paginate(Keys())
  ),
  5.seconds
))
Not available in this language yet.
{
  "object": {
    "data": [
      {
        "@ref": {
          "id": "251385778164204032",
          "collection": {
            "@ref": {
              "id": "keys"
            }
          }
        }
      }
    ]
  }
}
map[data:[{251385778164204032 0xc0000a9350 0xc0000a9350 <nil>}]]
{data: [ref(id = "251385778164204032", collection = ref(id = "keys"))]}
{ data: [ Ref(Keys(), "251385778164204032") ] }
{'data': [Ref(id=251385778164204032, collection=Ref(id=keys))]}
{data: [ref(id = "251385778164204032", collection = ref(id = "keys"))]}

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve! documentation@fauna.com

Thank you for your feedback!