LokiDB icon indicating copy to clipboard operation
LokiDB copied to clipboard

Rename meta field

Open elmarti opened this issue 4 years ago • 0 comments

[ ] 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

elmarti avatar Sep 21 '21 15:09 elmarti