set.first()
Get the first value in the Set.
Description
The first()
method gets the first value in the Set.
Examples
Get the first Customers document:
Customer.all().first()
{
id: "<CUSTOMER_DOCUMENT_ID>",
coll: Customer,
ts: Time("2099-07-31T12:42:19Z"),
cart: Order("<ORDER_DOCUMENT_ID>"),
orders: "hdW...",
name: "Alice Appleseed",
email: "alice.appleseed@example.com",
address: {
street: "87856 Mendota Court",
city: "Washington",
state: "DC",
postalCode: "20220",
country: "US"
}
}
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!