Why am I getting "Type 'String' cannot be used as an index type" error in TypeScript?

Solution 1:

Use lowercase string for the type of MyObject._id