Coder Social home page Coder Social logo

Comments (7)

Belphemur avatar Belphemur commented on July 1, 2024 2

I've decided to do 2 things:

  1. Add to the readme the limitation
  2. Let the user choose the separator see #76

You'll have control on what to use and it not conflicting with your own variable name.

from node-json-db.

iainvm avatar iainvm commented on July 1, 2024

datapaths and data are treated differently.

from node-json-db.

Belphemur avatar Belphemur commented on July 1, 2024

I don't see an easy way to resolve this without having to check the key of the object that are push. This could have a huge impact on the performance depending on of the depth and size of the object.

I'll put this as a known issue in the readme.

from node-json-db.

iainvm avatar iainvm commented on July 1, 2024

Since searching the object that is pushed has performance issues, and is a pain, you could make a way of escaping the "/" in the key, so that it can be resolved and found.

Naive approach, have the key needing escaping. So if there is a "//" (e.g. "bad//key") it will actually include the / in the keyname (i.e. "bad/key"). The only drawback to this is searching for a empty string key. Though that seems more unlikely than a key with a "/" in it.

from node-json-db.

Belphemur avatar Belphemur commented on July 1, 2024

I see your point, but since the code work by first splitting each part using the slash (/) as glue, it will need a good refactor of the code which I'm not really keen on doing.

It would be easier for the dev to not use the "/" as part of their object key name since it's used as key separator by JsonDB.

from node-json-db.

iainvm avatar iainvm commented on July 1, 2024

You process the key from a string to an array by splitting on the "/", the method could be overloaded to accept an array outright, giving some heavy lifting to the user of JsonDB but more usability. So allowing them to pass in an already split data path. This would require little to no refactoring.

from node-json-db.

iainvm avatar iainvm commented on July 1, 2024

If this is going to be a known bug, the README.md should be updated to reflect it.

from node-json-db.

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.