galleryApi
parent
554b4e8946
commit
879a792907
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue