Re:Ask HN: Why are you using MongoDB?
by tehlike on Saturday September 05, 2020 @11:55PM
(#24388852)
Not always - depending on the underlying linq provider, you could probably query the child collection diretly without join and it would generate the proper sql. It's a function of ORM though, but if you are using linq you probably have EF or NHibernate going for it (i was a former nhibernate developer around the time linq support was added)
Re:Ask HN: Why are you using MongoDB?
by scarface74 on Sunday September 06, 2020 @12:17AM
(#24388934)
Yes you usually can query the child directly. I did a bunch of left joins with LINQ when I knew SQL, but didn’t understand how EF worked as well as I do now.
I watched videos by Julie Lerman and since then I learned that any time you do an explicit join with EF, you’re probably doing it wrong.
I haven’t used Mongo in years , but I would be surprised if there isn’t some type of annotation that you could do on a class to tell the driver how to map the relationships so it would do it implicitly.
My recent experience with DynamoDB best practices though is that is usually a smell when you try to bring over relational thinking to a NoSQL database and you should carefully think about your design decisions.
https://www.axonize.com/blog/iot-technology/joining-collecti...
The weird left join syntax for LINQ with Mongo is endemic to how LINQ does left joins even with an RDMS. Yeah it’s obtuse.