-
Type: Bug
-
Resolution: Works as Designed
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: StrictFilter, TypeScript
-
None
What problem are you facing?
When using dynamic variables for the $set key TypeScript gives an error, but if I hardcode it to a number then I don't get an error. I believe this is a typing issue because the following code shouldn't have any type errors.
```ts
export interface AddStructureOptions
export const addStructure = async (
{ player, structure, }: AddStructureOptions) =>
{ player.bases[0].structures[structure.position] = structure; await db.players.updateOne( \{ _id: player._id },
{
$set: {
[`bases.0.structures.${structure.position}`]: structure,
},
}
);
};
```
What driver and relevant dependency versions are you using?
4.13.0