-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: 4.13.0, 4.12.1
-
Component/s: TypeScript
-
None
What problem are you facing?
The TS types don't allow you to $set a document with an object of the same type as the collection if that type includes arrays.
Here's the interface:
What driver and relevant dependency versions are you using?
MongoDB v4.13.0, TypeScript v4.9.4, Node v18.12.1
Steps to reproduce?
- Create an interface where one of the properties is an array
- Assign that interface to a collection
- Try to update a document in that collection by using $set with an object of the same type as the interface
- Workaround: try to do the same but instead of doing $set: obj, do $set: { ...obj } (this works for some reason)