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

missing fields defined as {} #101

Open
AlbertHambardzumyan opened this issue Aug 5, 2022 · 1 comment
Open

missing fields defined as {} #101

AlbertHambardzumyan opened this issue Aug 5, 2022 · 1 comment

Comments

@AlbertHambardzumyan
Copy link
Contributor

Hi

Given the following schema

const mongoose = require('mongoose')
const mongooseHidden = require('mongoose-hidden')()

const SomeSchema = new mongoose.Schema({
  field: { type: String, maxlength: 255 },
  meta: {
    data: {}
  }
}, { timestamps: true, minimize: false })

SomeSchema.plugin(mongooseHidden, { defaultHidden: { __v: true } })

I'm losing meta field entirely, as I do findOne.
I'm not sure whether I'm misusing the plugin or thats a bug.

mongoose: 5.12.5
mongoose-hidden: 1.6.1

@mblarsen
Copy link
Owner

mblarsen commented Aug 5, 2022

Could you create a test case here: https://github.com/mblarsen/mongoose-hidden/blob/master/test/github-issues.js?

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

2 participants