Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename meta field #193

Open
elmarti opened this issue Sep 21, 2021 · 0 comments
Open

Rename meta field #193

elmarti opened this issue Sep 21, 2021 · 0 comments

Comments

@elmarti
Copy link

elmarti commented Sep 21, 2021

[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/LokiJS-Forge/LokiDB/blob/master/CONTRIBUTING.md#question

Current behavior

When storing data in LokiDb, a meta field is created which stores data about the object. This is problematic because meta is a common name and leads to collisions with other field names called meta.

Expected behavior

Meta is prefixed with something to obfuscate the field such that collisions become very unlikely. e.g $lokiMeta.

We will need to handle older data, example logic:

if dbVersion <= 1.5 then use `meta` else `$lokiMeta`

Minimal reproduction of the problem with instructions

Insert data into a LokiDb with a field called meta.

What is the motivation / use case for changing the behavior?

Reduce friction in migrating to/using Loki by allowing the use of fields called meta

Environment

All

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant