Skip to content

Introspection has _id on embedded documents. #239

@RobertLowe

Description

@RobertLowe

So there is an issue with _id being created on embedded documents / objects.

Consider the following document:

{
  _id: "foobar",
  emails: [{address: "foo@example.com}]
}

Will be introspected with: _id:

Screen Shot 2020-08-01 at 11 58 54 PM

However after applying: UsersComposition.getFieldOTC('emails').removeField('_id');

Screen Shot 2020-08-01 at 11 51 13 PM

It's gone. What's up here?

And example of the schema:

const UsersSchema = new Schema(
  {
    _id: { type: String }
    emails: [
      {
        address: {type: String, index: true},
        verified: Boolean
      },
    ],
  { strict: false, versionKey: false, autoIndex: false }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions