Credential.all()
Learn: Credentials |
---|
Get a Set of all credentials.
Signature
Credential.all() => Set<Credential>
Credential.all(range: { from: Any } | { to: Any } | { from: Any, to: Any }) => Set<Credential>
Description
Gets a Set containing all
credentials, represented as
Credential
documents, for the
database. To limit the returned Set, you can provide an optional range.
If this method is the last expression in a query, the first page of the Set is returned. See Pagination.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
range |
|
Specifies a range of The Set only includes documents in this range (inclusive). Omit If a range is omitted, all credentials are returned. |
Range parameters
Name | Type | Required | Description |
---|---|---|---|
|
Beginning of the range (inclusive). Must be an
|
||
|
End of the range (inclusive). Must be an
|
Return value
Type | Description |
---|---|
Set of The Set is empty if:
|
Examples
Range examples
-
Get all credentials for the database:
Credential.all()
{ data: [ { id: "401670531158376525", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("111") }, { id: "401670531164667981", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("222") }, { id: "401670531170959437", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("333") } ] }
-
Given the previous Set, get all credentials starting with the credential for
Customer("222")
(inclusive):Credential.all({ from: Credential.byDocument(Customer.byId("222")) })
{ data: [ { id: "401670531164667981", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("222") }, { id: "401670531170959437", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("333") } ] }
-
Get a Set of credentials from the credential for
Customer("111")
(inclusive) to the credential forCustomer("222")
(inclusive):Credential.all({ from: Credential.byDocument(Customer.byId("111")), to: Credential.byDocument(Customer.byId("222")) })
{ data: [ { id: "401670531158376525", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("111") }, { id: "401670531164667981", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("222") } ] }
-
Get a Set of credentials up to the credential for
Customer("222")
(inclusive):Credential.all({ to: Credential.byDocument(Customer.byId("222")) })
{ data: [ { id: "401670531158376525", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("111") }, { id: "401670531164667981", coll: Credential, ts: Time("2099-06-25T13:21:59.270Z"), document: Customer("222") } ] }