Skip to content
This repository was archived by the owner on Jun 29, 2021. It is now read-only.
This repository was archived by the owner on Jun 29, 2021. It is now read-only.

Accessing document's _id from virtual property #224

@rosscoombes

Description

@rosscoombes

Apologies if this is elsewhere but I've failed to find the answer.

I have created a Model and I wanted to define a virtual property, I can access all the other model properties except _id., at least not in a proper Typescript manner.

@prop()
get tags() : Promise<Tag[]> {
console.log(this._id); //not valid, doesn't compile in TS
console.log(this['_id']); //does actually work
....
}

Just wondered whether there was a better approach for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions