galleryApi
dev2 siliconpin 2024-08-13 11:56:40 +00:00
parent 554b4e8946
commit 879a792907
1 changed files with 4 additions and 3 deletions

View File

@ -2,15 +2,16 @@ const getGameScore = (req, res) => {
const { MongoClient } = require('mongodb');
async function main() {
const uri = 'mongodb://mongoadmin:Bijaynagardwd@10.0.0.90:27017'; // Replace with your MongoDB connection string
const client = new MongoClient(uri, { useNewUrlParser: true, useUnifiedTopology: true });
const url = process.env.MONGODB_URL;
const dbName = process.env.MONGO_DB_NAME;
const client = new MongoClient(url, { useNewUrlParser: true, useUnifiedTopology: true });
try {
// Connect to the MongoDB client
await client.connect();
// Select the database and collection
const database = client.db('iimttnewdb'); // Replace with your database name
const database = client.db(dbName); // Replace with your database name
const collection = database.collection('gameData'); // Replace with your collection name
// Find a single document