Skip to content

Commit

Permalink
兼容AWS DocumentDB (#1647)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick2wang authored Jul 1, 2022
1 parent 2a945f5 commit d681cc7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sql/engines/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,10 @@ def get_all_columns_by_tb(self, db_name, tb_name, **kwargs):
for d in db[collection_name].find().limit(2):
documents_sample.append(d)
else:
for d in db[collection_name].find().sort([("$natural", 1)]).limit(1):
for d in db[collection_name].find().sort([("_id", 1)]).limit(1):
documents_sample.append(d)

for d in db[collection_name].find().sort([("$natural", -1)]).limit(1):
for d in db[collection_name].find().sort([("_id", -1)]).limit(1):
documents_sample.append(d)
columns = []
# _merge_property_names
Expand Down

0 comments on commit d681cc7

Please sign in to comment.