Update index.js
Browse files
index.js
CHANGED
@@ -137,10 +137,7 @@ app.get('/testdb', async (req, res) => {
|
|
137 |
const collection = dbClient.collection("api_keys");
|
138 |
try {
|
139 |
const result = await collection.find({}).toArray();
|
140 |
-
|
141 |
-
const ownerCount = data.owner === undefined ? 0 : 1;
|
142 |
-
res.json({ count: ownerCount });
|
143 |
-
}
|
144 |
} catch (error) {
|
145 |
console.error("Failed to get data from DB: " + error);
|
146 |
res.status(500).send("Error fetching data from database.");
|
|
|
137 |
const collection = dbClient.collection("api_keys");
|
138 |
try {
|
139 |
const result = await collection.find({}).toArray();
|
140 |
+
res.json({ count: result.owner });
|
|
|
|
|
|
|
141 |
} catch (error) {
|
142 |
console.error("Failed to get data from DB: " + error);
|
143 |
res.status(500).send("Error fetching data from database.");
|