With this method you can access a Model from an entity instance.
constBlogPost=require('blog-post.model');constblogEntity=newBlogPost({ title:'Blog title' });blogEntity.save().then(() => {constImage=blogEntity.model('Image'); // access the 'Image' ModelconstimageEntity=newImage({ uri:'http://domain.com/image.jpg' });...});// Example on middleware (schema 'pre' save)commentSchema.pre('save',functionbeforeSave(){// Reminder: in a "save" middelware, the scope (this) is the entity being savedconstUser=this.model('User');returnUser.get(this.entityData.userIdx).then(() => {... });});