Skip to content

Commit

Permalink
Merge pull request #274 from atlanticwave-sdx/exclude-deleted-connect…
Browse files Browse the repository at this point in the history
…ion-when-listing

Exclude deleted connections when listing all connections
  • Loading branch information
congwang09 committed May 21, 2024
2 parents 1893499 + d11ca37 commit d8a2c3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdx_controller/utils/db_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def read_from_db(self, collection, key):
def get_all_entries_in_collection(self, collection):
db_collection = self.sdxdb[collection]
# MongoDB has an ObjectId for each item, so need to exclude the ObjectIds
all_entries = db_collection.find({}, {"_id": 0})
all_entries = db_collection.find({"deleted": {"$ne": True}}, {"_id": 0})
return all_entries

def mark_deleted(self, collection, key):
Expand Down

0 comments on commit d8a2c3b

Please sign in to comment.