-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
[BUG] No way to retrieve SchemaDefinition from Schema #1595
Comments
This comment was marked as outdated.
This comment was marked as outdated.
@lmanerich I have hidden your last comment. Using undocumented properties, classes, methods/functions is HIGHLY discouraged. Please see https://dynamoosejs.com/other/FAQ#can-i-use-an-undocumented-property-class-method-or-function-in-dynamoose for more details. You mention |
Hey @fishcharlie hope you are doing great. Using the Schema object as schema reference export const UserSchema = new dynamoose.Schema({
name: {
required: true,
type: String,
},
company: {
type: Object,
schema: CompanySchema, // results in error
},
}); results in the following error message
|
It looks like you are just trying to reference another Model. If that is the case based on this documentation for the Model type, you should be able to do this export const UserSchema = new dynamoose.Schema({
name: {
required: true,
type: String,
},
company: CompanySchema
}); |
Summary:
In Dynamoose V2 it was possible to created nested schema relations by using
In V3 this attribute is no longer available and I found no way to getting the SchemaDefinition from a Schema object.
Code sample:
Schema
Model
General
Current output and behavior (including stack trace):
Expected output and behavior:
Nested schema definition loaded
Environment:
Operating System: Windows
Operating System Version: 11 Pro
Node.js version (
node -v
): 18NPM version: (
npm -v
): v18.16.0Dynamoose version: 3.2.0
Other information (if applicable):
Other:
The text was updated successfully, but these errors were encountered: