This is my creating index code.
try {
// Connect the client to the server
await client.connect();
// Establish and verify connection
await client.db('admin').command({ ping: 1 });
console.log('Connected successfully to server');
const database = client.db("parse")
const collection = database.collection("TblColllection")
await collection.createIndex({ tokenURIData: "text" })
console.log('Created index successfully');
} finally {
// Ensures that the client will close when you finish/error
await client.close();
}