Skip to content

ASk : Sort & Limit #60

Answered by mehran-prs
zyahrial asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @zyahrial

Same as the sort and limit in the MongoDB driver itself. e.g.,

mgm.coll(&User{}).SimpleFindWithCtx(ctx, &models, bson.M{}, &options.FindOptions{
		Limit: &limit,
		Skip:  &offset,
	})

Use FindOptions in the go.mongodb.org/mongo-driver/mongo/options package.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mehran-prs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants