From fb8e2a455c68d14de98c58462cbba7d758f7386a Mon Sep 17 00:00:00 2001 From: nick2wang Date: Wed, 29 Jun 2022 15:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9AWS=20DocumentDB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/engines/mongo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/engines/mongo.py b/sql/engines/mongo.py index 0bf03e2b62..7812eadf4d 100644 --- a/sql/engines/mongo.py +++ b/sql/engines/mongo.py @@ -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