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

How to define a non-virtual getter #192

Closed
bangbang93 opened this issue Sep 12, 2018 · 3 comments
Closed

How to define a non-virtual getter #192

bangbang93 opened this issue Sep 12, 2018 · 3 comments

Comments

@bangbang93
Copy link

If using schema, I can do like this

{
    type: String,
    index: 'text',
    get(this: IMessageSchema, message) {
      if (this.type === Message.EnumType.deleted) {
        return ''
      }
      return message
    },
  },

But it seems like if i using get in typegoose, it must be a virtual field

@hasezoey

This comment has been minimized.

@hasezoey
Copy link
Contributor

hasezoey commented Aug 7, 2019

this can be closed in favor of #260
-> included in 6.0.0 (since 6.0.0-9)

@Ben305

@hasezoey

This comment has been minimized.

@Ben305 Ben305 closed this as completed Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants