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

Sub document relationships aren't working #7

Open
brandonpassley opened this issue Jun 20, 2016 · 2 comments
Open

Sub document relationships aren't working #7

brandonpassley opened this issue Jun 20, 2016 · 2 comments
Labels

Comments

@brandonpassley
Copy link
Member

  • Create a schema
  • Create a sub-schema and add it to one of the items in the parent schema as an array
  • Have one of the sub-schema properties be a relationship
  • View admin portal and see that there is no way to update the sub-schema relationship

Example of a schema that isn't working...

const PolicySchema = new Schema({
  _policy:      { type: Schema.Types.ObjectId, ref: 'Policy' },
  lowRange:     { type: Number },
  highRange:    { type: Number },
}, { timestamps: true });

const QuoteSchema = new Schema({
  _user:            { type: Schema.Types.ObjectId, ref: 'User', required: true },
  industry:         { type: String, required: true },
  state:            { type: String, required: true },
  policies:         [PolicySchema],
  staff:            { type: String, required: true },
  yearsInBusiness:  { type: String, required: true },
  revenue:          { type: String, required: true },
  priorClaims:      { type: Boolean, required: true }
}, { timestamps: true });
cablej added a commit that referenced this issue Jun 20, 2016
@cablej cablej added bug and removed bug labels Jun 20, 2016
@cablej
Copy link
Contributor

cablej commented Jun 20, 2016

As a temporary fix, add searchBy: '...' to any relationships in sub documents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants