1
0
Fork 0
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:
Tlams 2018-02-18 17:52:09 +00:00
parent 230a792d5c
commit 3668862faa

View file

@ -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 = {