Skip to content

Commit

Permalink
updated_version_1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvaneshkm committed Sep 28, 2024
1 parent aef798d commit d6df77b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dbsconnector/databases.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# importing necessary libraries
import pandas as pd
import pymongo
from pymongo import MongoClient
from pathlib import Path
import warnings
Expand Down Expand Up @@ -88,5 +89,7 @@ def upload_object(
def load_object(self, database: str, collection_name: str, object_name: str):
database_connect = self.mongoclinet[database]
collection = database_connect[collection_name]
object_ = collection.find_one({"object_name": object_name})
object_ = collection.find_one(
{"object_name": object_name}, sort=[("_id", pymongo.DESCENDING)]
)
return object_

0 comments on commit d6df77b

Please sign in to comment.