0

I would like to know how to limit a query (server side. My knowledge is Meteor). For example, the comments of a particular post instead of retrieving all the comments in database.

I want it to be limited server side to avoid malicious client to fetch all the data of the database.

Thanks.

2 Answers2

0

You could use limit. For example: post.comments.limit(10)

heri
  • 11
  • 1
  • 3
0

I think we talked about this in gitter, but I'm planning to add a query_restrictions api where you can reject queries that you don't like. I'll probably add a default globally configurable limit also. (that you can override on a per model basis)

Ryan
  • 956
  • 7
  • 8