Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {$push: {
- "progress.$.exercise":{
- "exercise":exercise
- }
- }
- {$push: {
- "progress.$.exercise.$.workout":{
- "_set":_set,
- "reps":reps,
- "weight":weight
- }
- }
- var Workout = new mongoose.Schema({
- _set : {
- type: String
- },
- reps: {
- type: String
- },
- weight: {
- type: String
- }
- });
- var Exercise = new mongoose.Schema({
- exerciseName : {
- type: String
- },
- workout : [Workout]
- });
- var Progress = new mongoose.Schema({
- date : {
- type: String
- },
- name : {
- type: String
- },
- exercise : [Exercise]
- });
- var UserSchema = mongoose.Schema({
- username: {
- type: String,
- index:true
- },
- password: {
- type: String
- },
- email: {
- type: String
- },
- name: {
- type: String
- },
- progress : [Progress]
- });
- var User = module.exports = mongoose.model('User', UserSchema);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement