Skip to content

LokiDb expects data to not have a meta field #187

@gotenxds

Description

@gotenxds

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions