Friday, 3 August 2018

Referencing the properties of another model schema in a new model schema for Mongoose?

So I'm creating a web app that utilizes a Node.js API, which is connected to a MongoAtlas database. I have one schema, User, and it has the properties id, email, and password. Now, I'm creating a new model schema that is called Spellbook, and I want to save the user's email as one of the properties of the spellbook so that later on I can find a spellbook by the user who owns it.How would I go about referencing the User model property in the Spellbook schema?

Submitted August 03, 2018 at 08:52PM by mondaynes

No comments:

Post a Comment