Found an answer to my question, I just need to add the subQuery = false so that the limit and offset will not be evaluated to sub query. And the offset and limit is also in the end of the query.
offset:((page-1)*limit),
limit : limit,
subQuery:false