- Add log for registration TTL

- Bump version
This commit is contained in:
Fred Boniface 2024-03-01 20:39:13 +00:00
parent bd69ee0d58
commit 7ca6074752
2 changed files with 8 additions and 2 deletions

View File

@ -14,7 +14,7 @@
# program. If not, see
# https://git.fjla.uk/OwlBoard/db-manager/src/branch/main/LICENSE
version = "2024.2.1"
version = "2024.3.0"
print(f"main.py: Initialising db-manager v{version}")
#Third Party Imports
@ -60,6 +60,8 @@ except:
mongo.dropCollection("registrations")
mongo.createTtlIndex("registrations", "time", 14400)
log.out(f"Indexes for 'registrations': {list(mongo.listIndexes('registrations'))}")
# Push version number to database for reporting
mongo.putVersion(version)

View File

@ -140,4 +140,8 @@ def query(collection, query):
def deleteMany(collection :str, filter :dict):
col = db[collection]
incrementCounter(collection)
return col.delete_many(filter)
return col.delete_many(filter)
def listIndexes(collection :str):
col = db[collection]
return col.list_indexes()