mirror of
https://github.com/ThomasGsp/HyperProxmox.git
synced 2025-02-12 19:22:30 +00:00
Fix MongoDB - find by ID
This commit is contained in:
parent
230a792d5c
commit
3668862faa
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
from pymongo import MongoClient
|
||||
from bson.objectid import ObjectId
|
||||
from bson.json_util import dumps
|
||||
import json
|
||||
import redis
|
||||
|
@ -86,7 +87,7 @@ class MongoDB:
|
|||
try:
|
||||
result = {
|
||||
"result": "OK",
|
||||
"value": json.loads(dumps(self.db[collection].find({"_id": id})))
|
||||
"value": json.loads(dumps(self.db[collection].find_one({"_id": ObjectId(id)})))
|
||||
}
|
||||
except BaseException as e:
|
||||
result = {
|
||||
|
|
Loading…
Reference in a new issue