Code Monkey home page Code Monkey logo

Comments (2)

FarooqKhan avatar FarooqKhan commented on August 26, 2024

Hi Joel,

  1. Deep copying was done so that the objects in memory would be disconnected from the objects returned by the various query method.
  2. Not doing deep copy has one side effect, once you have queried and obtained object(s) from the JsonDB you can then change the contents of that object and those changes would also be done in the JsonDB memory, this would not be issue normally, however, it might cause subtle bugs especially in case of the update methods. You might end up assuming that I have changed the object and it is all done however the change will not be written to the files. This would mean data in cache is out of sync with data in the files. However, if you continue to invoke the update methods without fail you can choose not to do deep copy and it should all work fine.
  3. Data files can be loaded in 2 ways. a) at the time of constructor invocation everything in data folder is loaded up front. b) you can invoke reload() method to load a particular collection again on demand. You can also register for event listners (though they don't work on mac) and reload based on events received when underlying data files change

Thanks

from jsondb-core.

FarooqKhan avatar FarooqKhan commented on August 26, 2024

I do not plan to change this behaviour at the moment. In future if time permits i can try and make it configurable, until then i am going to mark it wont fix

from jsondb-core.

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.