Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix mongo query skip() does not work #1782

Merged
merged 1 commit into from
Aug 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sql/engines/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,10 @@ def query(self, db_name=None, sql="", limit_num=0, close_conn=True, **kwargs):
if "limit" in query_dict and query_dict["limit"]:
query_limit = int(query_dict["limit"])
limit = min(limit_num, query_limit) if query_limit else limit_num
find_cmd += ".limit(limit)"
find_cmd += f".limit({limit})"
if "skip" in query_dict and query_dict["skip"]:
query_skip = int(query_dict["skip"])
find_cmd += f".skip({query_skip})"
if "count" in query_dict:
find_cmd += ".count()"
if "explain" in query_dict:
Expand Down