ASk : Sort & Limit #60
-
How to use sort and limit that using mgm for find documents |
Beta Was this translation helpful? Give feedback.
Answered by
mehran-prs
Jan 22, 2022
Replies: 1 comment
-
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 |
Beta Was this translation helpful? Give feedback.
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
Hi @zyahrial
Same as the sort and limit in the MongoDB driver itself. e.g.,
Use
FindOptions
in thego.mongodb.org/mongo-driver/mongo/options
package.