[ ] Implement Collections.mjs which reads from collectionsFields.mjs and returns a MongoDB schema that we can add to _schema/index.mjs.
collectionsFields.mjs:
Your job is to write Collections.mjs such that it returns a proper database schema for MongoDB. Essentially you just take collectionsConfig and run through the JSON and convert it to the format of the MongoDB schema.
Read through MongoDB schema docs for help
*notes:
shortText --> string
longText --> string
date --> string
mediaList --> list of Media objects. Grab from media schema (look at Trainer.mjs to see how to define embedded schemas)
If Media schema isn't ready yet, just define a dummy schema for testing.
Remember to add to the index.mjs file in the end You can use the ...object syntax to do so
[ ] Implement Collections.mjs which reads from collectionsFields.mjs and returns a MongoDB schema that we can add to _schema/index.mjs.
collectionsFields.mjs:
Your job is to write
Collections.mjs
such that it returns a proper database schema for MongoDB. Essentially you just take collectionsConfig and run through the JSON and convert it to the format of the MongoDB schema.Read through MongoDB schema docs for help
*notes:
Remember to add to the index.mjs file in the end You can use the
...object syntax
to do so