mingo-app / mingo

Found a bug? have a FR ?
59 stars 3 forks source link

NodeShell snippet for Update fails when collection has a dot #615

Closed thiagotsn closed 7 months ago

thiagotsn commented 8 months ago

Describe the bug When selecting rows and clicking Update, it changes to NodeShell with a UpdateMany snippet. The snippet works fine for a collection such products (return await products.updateMany). When it's a collection such as products.details (return await distributors.catalog.updateMany), it won't work because of the dot, leading to a TypeError: Cannot read properties of undefined (reading 'updateMany').

A suggestion would be to detect the dot and instead the snippet uses return await db.collection("products.details").updateMany

Screenshots CleanShot 2023-10-27 at 22 17 12@2x

Desktop (please complete the following information):

tothradoslav commented 7 months ago

Thanks for reporting this. We fixed it. Will be available in the next release.

tothradoslav commented 7 months ago

Hi, this has been released in the latest version. Please check it out and let us know if there's still an issue. Thank you!