* Overwrites native Map's `get()` function to support Mongoose getters. * * @api public * @method get * @memberOf Map
(key, options)
| 53 | */ |
| 54 | |
| 55 | get(key, options) { |
| 56 | if (isBsonType(key, 'ObjectId')) { |
| 57 | key = key.toString(); |
| 58 | } |
| 59 | |
| 60 | options = options || {}; |
| 61 | if (options.getters === false) { |
| 62 | return super.get(key); |
| 63 | } |
| 64 | return this.$__schemaType.applyGetters(super.get(key), this.$__parent); |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * Overwrites native Map's `set()` function to support setters, `populate()`, |