Files
ent/doc/md/paging.md
Ariel Mashraki fd0a7f9f02 all: facebookincubator/ent => facebook/ent (#660)
ent repository is going to be migrated to facebook organization
2020-08-18 11:05:08 +03:00

493 B
Executable File

id, title
id title
paging Paging And Ordering

Limit

Limit limits the query result to n entities.

users, err := client.User.
	Query().
	Limit(n).
	All(ctx)

Offset

Offset sets the first vertex to return from the query.

users, err := client.User.
	Query().
	Offset(10).
	All(ctx)

Ordering

Order returns the entities sorted by the values of one or more fields.

users, err := client.User.Query().
	Order(ent.Asc(user.FieldName)).
	All(ctx)