Coder Social home page Coder Social logo

Comments (2)

ssteiner avatar ssteiner commented on August 15, 2024

Did you look at what is contained in these children? With DbRef, if you do not do the Include, you'll still get the Object, but it contains just the Id, nothing more. Then, to set a child, you don't have to look up the child, you just instantiate a new child with the right Id and LiteDB figures out the rest.
LiteDb stores object type and Id of a DbRef - and auto-hydrates it - but it doesn't really read the child, it just instantiates the object and fills the Id, and that's it.

Yes if feels weird coming from EF (I took the same path), and I had to adapt my workflow a bit, but in the end, it's just one of those things that are different between SQL and NoSql. I've been working with MongoDB and RavenDB recently and they have their own different way of handling these things - they don't auto-hydrate but their way of handling DbRefs is in the end even more different from EF (and not in a good way imho).

from litedb.

RedQueen87 avatar RedQueen87 commented on August 15, 2024

Great, I see now.
All Name properties are NULL when I don't use .Include(...).
And with .Include(...) it contains inserted string.
So now I am sure its not a bug but a feature :)
Thanks for explanation

from litedb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.