Support for geo search

This commit is contained in:
2023-01-02 15:08:46 +01:00
parent 075f08a8c1
commit ea1b92015d
3 changed files with 32 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
from modules.utils import configGet
from pymongo import MongoClient
from pymongo import MongoClient, GEOSPHERE
db_config = configGet("database")
@@ -32,4 +32,6 @@ col_users = db.get_collection("users")
col_albums = db.get_collection("albums")
col_photos = db.get_collection("photos")
col_videos = db.get_collection("videos")
col_tokens = db.get_collection("tokens")
col_tokens = db.get_collection("tokens")
col_photos.create_index([("location", GEOSPHERE)])