Best practice for drilling into more detail on a single record and pulling more fields from the database?

Yep, that’s the issue… you will get the state, but be unable to additionally pull the city. But if you don’t pull anything from address the first time around, then you WOULD be able to pull the city.

Wow! Great discovery and I believe it deserves more attention and recognition.

I’m sure there are a lot of serious apps out there that sooner or later may hit this wall and the devs would be scratching puzzled heads.

Thanks @wesyah234 for discovering and sharing this and thanks @maxhodges for providing a simple reproduction.

1 Like

no problem. hopefully I can put together an even simpler example sometime, now that I fully understand what’s going on.

I think I read somewhere regarding this that “sooner or later everyone will run into this “gotcha””… so, if it’s something that we are aware many people are going to run into, and struggle with, I would think it should at the least be documented more clearly. And preferably I would like to see it addressed.

One comment was that it was done this way to keep the DDP “less complex”. But I would venture a guess that many of us who need this granularity with their fields and nested structures, would gladly trade a few milliseconds on the DDP layer VS having to code workarounds that end up pulling more data into the client (which is what I am doing), by having separate collections on the client for the same collection on the mongo db.

1 Like