Closed imxuedi closed 1 year ago
Definitely Sure!
I find that lodash can do this.
Lodash YYDS. LowDB YYDS.
It doesn't support it but it can be added with another library.
For example, with dot-prop: https://github.com/sindresorhus/dot-prop
getProperty(db.data, 'foo.bar')
With lodash, see: https://github.com/typicode/lowdb#lodash
Lodash get()
supports it.
Thanks for your generous answer. It indeed solves my problem.
You're welcome. Glad it helped :)
I'm from 'electron-store', the dot syntax attracts me, like:
I can visit subkey1 by
store.get("obj['key2'][0]")
, I just need to prepare a path string.I konw that Js supports dynamic property like:
but what if multi dynamic property?
I have no idea about how to realize above by lowdb or could anyone give me some suggestions? Thanks.