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

LokiDb expects data to not have a meta field #187

Open
gotenxds opened this issue Oct 6, 2020 · 0 comments
Open

LokiDb expects data to not have a meta field #187

gotenxds opened this issue Oct 6, 2020 · 0 comments

Comments

@gotenxds
Copy link

gotenxds commented Oct 6, 2020

I'm submitting a...

[X] Bug report

Current behavior

Today, when inserting a new object to a collection, LokiDb adds a meta property to that object on to which it writes a version property

            if (!this._disableMeta) {
                newDoc.meta.version = 0;
            }

If the object already has a meta property and it is set to null (as per my case) then loki will try and set null.version = 0
Which causes an error

Expected behavior

Loki should not reserve properties without some kind of prefix or suffix as for example 'meta' is a common property name.
but instead should maybe follow the $loki property name and be called $meta or just put the meta prop in $loki

Minimal reproduction of the problem with instructions

just create a collection and insert {meta: null}

Environment

Latest loki version

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