Is it possible to obtain the TokenID or ContractAddress using the TokenURI?

Noob alert - I am new to openzeppelin and smart contract development.

While minting the nfts, I intend to check if any tokens have already been minted using the TokenURI that I am trying to use and further, return the ContractAddress or TokenID if it is so. Is there any method/ function that can get this done or even is it logically feasible to do this ?

Thanks

you need to make an array for saving nfts when minting in the smart contract function.