Keys

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

Description

The Keys function returns the Set of key references in the specified database. If no database is provided, it returns the set of key references in the current database.

Parameters

Argument Type Definition and Requirements

database

Ref

Optional - The source database. If not specified, the current database is used.

Returns

A Set reference that includes all of the keys available in the specified database.

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!