SHARE
TWEET

Lab 3a

dado3212 May 21st, 2017 (edited) 571 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Choose the given database
  2. use Team19DB;
  3.  
  4. // Authors
  5. db.authors.drop();
  6. var insertedAuthors = db.authors.insertMany([
  7.   {
  8.     "first_name": "Marny",
  9.     "last_name": "Mcclain",
  10.     "email_address": "nulla.ante@ligula.org",
  11.     "mailing_address": "P.O. Box 673,\n8932 Molestie Ave"
  12.   },
  13.   {
  14.     "first_name": "Finn",
  15.     "last_name": "Ryan",
  16.     "email_address": "convallis@egetmassa.co.uk",
  17.     "mailing_address": "Ap #502-7575 Odio. St."
  18.   },
  19.   {
  20.     "first_name": "Mari",
  21.     "last_name": "Bowers",
  22.     "email_address": "ac.facilisis@nonhendrerit.ca",
  23.     "mailing_address": "4706 Odio. St."
  24.   },
  25.   {
  26.     "first_name": "Eden",
  27.     "last_name": "Mathews",
  28.     "email_address": "quis@Curabitur.net",
  29.     "mailing_address": "792-5985 Felis St."
  30.   },
  31.   {
  32.     "first_name": "Jared",
  33.     "last_name": "Hart",
  34.     "email_address": "pellentesque.eget.dictum@vulputatenisi.ca",
  35.     "mailing_address": "8351 Sed St."
  36.   },
  37.   {
  38.     "first_name": "Ali",
  39.     "last_name": "Holmes",
  40.     "email_address": "mollis.dui@risus.edu",
  41.     "mailing_address": "P.O. Box 801,\n 463 Erat Rd."
  42.   },
  43.   {
  44.     "first_name": "Scarlett",
  45.     "last_name": "Stafford",
  46.     "email_address": "Nunc.laoreet@blandit.com",
  47.     "mailing_address": "Ap #548-9177 Ipsum. Rd."
  48.   }
  49. ], {
  50.   "ordered": false
  51. });
  52.  
  53. // Create editors
  54. db.editors.drop();
  55. var insertedEditors = db.editors.insertMany([
  56.   {
  57.     "first_name": "Alex",
  58.     "last_name": "Beals"
  59.   },
  60.   {
  61.     "first_name": "Scott",
  62.     "last_name": "Bohn"
  63.   }
  64. ], {
  65.   "ordered": false
  66. });
  67.  
  68. // RICodes
  69. db.ricodes.drop();
  70. var insertedCodes = db.ricodes.insertMany([
  71.   { "name": "Agricultural engineering" },
  72.   { "name": "Biochemical engineering" },
  73.   { "name": "Biomechanical engineering" },
  74.   { "name": "Ergonomics" },
  75.   { "name": "Food engineering" },
  76.   { "name": "Bioprocess engineering" },
  77.   { "name": "Genetic engineering" },
  78.   { "name": "Human genetic engineering" },
  79.   { "name": "Metabolic engineering" },
  80.   { "name": "Molecular engineering" },
  81.   { "name": "Neural engineering" },
  82.   { "name": "Protein engineering" },
  83.   { "name": "Rehabilitation engineering" },
  84.   { "name": "Tissue engineering" },
  85.   { "name": "Aquatic and environmental engineering" },
  86.   { "name": "Architectural engineering" },
  87.   { "name": "Civionic engineering" },
  88.   { "name": "Construction engineering" },
  89.   { "name": "Earthquake engineering" },
  90.   { "name": "Earth systems engineering and management" },
  91.   { "name": "Ecological engineering" },
  92.   { "name": "Environmental engineering" },
  93.   { "name": "Geomatics engineering" },
  94.   { "name": "Geotechnical engineering" },
  95.   { "name": "Highway engineering" },
  96.   { "name": "Hydraulic engineering" },
  97.   { "name": "Landscape engineering" },
  98.   { "name": "Land development engineering" },
  99.   { "name": "Pavement engineering" },
  100.   { "name": "Railway systems engineering" },
  101.   { "name": "River engineering" },
  102.   { "name": "Sanitary engineering" },
  103.   { "name": "Sewage engineering" },
  104.   { "name": "Structural engineering" },
  105.   { "name": "Surveying" },
  106.   { "name": "Traffic engineering" },
  107.   { "name": "Transportation engineering" },
  108.   { "name": "Urban engineering" },
  109.   { "name": "Irrigation and agriculture engineering" },
  110.   { "name": "Explosives engineering" },
  111.   { "name": "Biomolecular engineering" },
  112.   { "name": "Ceramics engineering" },
  113.   { "name": "Broadcast engineering" },
  114.   { "name": "Building engineering" },
  115.   { "name": "Signal Processing" },
  116.   { "name": "Computer engineering" },
  117.   { "name": "Power systems engineering" },
  118.   { "name": "Control engineering" },
  119.   { "name": "Telecommunications engineering" },
  120.   { "name": "Electronic engineering" },
  121.   { "name": "Instrumentation engineering" },
  122.   { "name": "Network engineering" },
  123.   { "name": "Neuromorphic engineering" },
  124.   { "name": "Engineering Technology" },
  125.   { "name": "Integrated engineering" },
  126.   { "name": "Value engineering" },
  127.   { "name": "Cost engineering" },
  128.   { "name": "Fire protection engineering" },
  129.   { "name": "Domain engineering" },
  130.   { "name": "Engineering economics" },
  131.   { "name": "Engineering management" },
  132.   { "name": "Engineering psychology" },
  133.   { "name": "Ergonomics" },
  134.   { "name": "Facilities Engineering" },
  135.   { "name": "Logistic engineering" },
  136.   { "name": "Model-driven engineering" },
  137.   { "name": "Performance engineering" },
  138.   { "name": "Process engineering" },
  139.   { "name": "Product Family Engineering" },
  140.   { "name": "Quality engineering" },
  141.   { "name": "Reliability engineering" },
  142.   { "name": "Safety engineering" },
  143.   { "name": "Security engineering" },
  144.   { "name": "Support engineering" },
  145.   { "name": "Systems engineering" },
  146.   { "name": "Metallurgical Engineering" },
  147.   { "name": "Surface Engineering" },
  148.   { "name": "Biomaterials Engineering" },
  149.   { "name": "Crystal Engineering" },
  150.   { "name": "Amorphous Metals" },
  151.   { "name": "Metal Forming" },
  152.   { "name": "Ceramic Engineering" },
  153.   { "name": "Plastics Engineering" },
  154.   { "name": "Forensic Materials Engineering" },
  155.   { "name": "Composite Materials" },
  156.   { "name": "Casting" },
  157.   { "name": "Electronic Materials" },
  158.   { "name": "Nano materials" },
  159.   { "name": "Corrosion Engineering" },
  160.   { "name": "Vitreous Materials" },
  161.   { "name": "Welding" },
  162.   { "name": "Acoustical engineering" },
  163.   { "name": "Aerospace engineering" },
  164.   { "name": "Audio engineering" },
  165.   { "name": "Automotive engineering" },
  166.   { "name": "Building services engineering" },
  167.   { "name": "Earthquake engineering" },
  168.   { "name": "Forensic engineering" },
  169.   { "name": "Marine engineering" },
  170.   { "name": "Mechatronics" },
  171.   { "name": "Nanoengineering" },
  172.   { "name": "Naval architecture" },
  173.   { "name": "Sports engineering" },
  174.   { "name": "Structural engineering" },
  175.   { "name": "Vacuum engineering" },
  176.   { "name": "Military engineering" },
  177.   { "name": "Combat engineering" },
  178.   { "name": "Offshore engineering" },
  179.   { "name": "Optical engineering" },
  180.   { "name": "Geophysical engineering" },
  181.   { "name": "Mineral engineering" },
  182.   { "name": "Mining engineering" },
  183.   { "name": "Reservoir engineering" },
  184.   { "name": "Climate engineering" },
  185.   { "name": "Computer-aided engineering" },
  186.   { "name": "Cryptographic engineering" },
  187.   { "name": "Information engineering" },
  188.   { "name": "Knowledge engineering" },
  189.   { "name": "Language engineering" },
  190.   { "name": "Release engineering" },
  191.   { "name": "Teletraffic engineering" },
  192.   { "name": "Usability engineering" },
  193.   { "name": "Web engineering" },
  194.   { "name": "Systems engineering" }
  195. ], {
  196.   "ordered": false
  197. });
  198.  
  199. // Reviewers
  200. db.reviewers.drop();
  201. var reviewers = [
  202.   {
  203.     "first_name": "Matt",
  204.     "last_name": "Abate",
  205.     "email": "test@test.com",
  206.     "affiliation": "Dartmouth College",
  207.     "codes": [ insertedCodes.insertedIds[0], insertedCodes.insertedIds[1], insertedCodes.insertedIds[2] ]
  208.   },
  209.   {
  210.     "first_name": "Andrew",
  211.     "last_name": "Wolff",
  212.     "email": "test@test.com",
  213.     "affiliation": "Dartmotuh College",
  214.     "codes": [ insertedCodes.insertedIds[0], insertedCodes.insertedIds[1], insertedCodes.insertedIds[3] ]
  215.   },
  216.   {
  217.     "first_name": "Carter",
  218.     "last_name": "Brace",
  219.     "email": "test2@test.com",
  220.     "affiliation": "Harvard University",
  221.     "codes": [ insertedCodes.insertedIds[1], insertedCodes.insertedIds[2], insertedCodes.insertedIds[3] ]
  222.   },
  223.   {
  224.     "first_name": "Test",
  225.     "last_name": "Name",
  226.     "email": "test3@test.com",
  227.     "affiliation": "Brigham-Young University",
  228.     "codes": [ insertedCodes.insertedIds[0], insertedCodes.insertedIds[1], insertedCodes.insertedIds[3] ]
  229.   }
  230. ];
  231. var insertedReviewers = db.reviewers.insertMany(reviewers, {
  232.   "ordered": false
  233. });
  234.  
  235. // Issues
  236. db.issues.drop();
  237. var insertedIssues = db.issues.insertMany([
  238.   {
  239.     "period": "4",
  240.     "publication_year": "2016",
  241.     "print_date": new Date(2016, 9, 30)
  242.   },
  243.   {
  244.     "period": "2",
  245.     "publication_year": "2017",
  246.     "print_date": null
  247.   }
  248. ], {
  249.   "ordered": false
  250. });
  251.  
  252. // Create main manuscripts
  253. db.manuscripts.drop();
  254. var insertedManuscripts = db.manuscripts.insertMany([
  255.   {
  256.     "title": "A Test Manuscript (Received)",
  257.     "affiliation": "Fringilla Company",
  258.     "status_date": new Date(),
  259.     "status": "received",
  260.     "document": "test",
  261.     "number_pages": null,
  262.     "order": null,
  263.     "page_start": null,
  264.     "submitting_author": insertedAuthors.insertedIds[0],
  265.     "editor_id": insertedEditors.insertedIds[0],
  266.     "ricode": insertedCodes.insertedIds[1],
  267.     "issue_id": null,
  268.     "secondary_authors": [
  269.       {
  270.         "first_name": "John",
  271.         "last_name": "Richardson"
  272.       },
  273.       {
  274.         "first_name": "Michael",
  275.         "last_name": "Oher"
  276.       }
  277.     ]
  278.   },
  279.   {
  280.     "title": "Test Manuscript 2 (Rejected)",
  281.     "affiliation": "Fringilla Company",
  282.     "status_date": new Date(),
  283.     "status": "rejected",
  284.     "document": "test",
  285.     "number_pages": null,
  286.     "order": null,
  287.     "page_start": null,
  288.     "submitting_author": insertedAuthors.insertedIds[2],
  289.     "editor_id": insertedEditors.insertedIds[0],
  290.     "ricode": insertedCodes.insertedIds[1],
  291.     "issue_id": null,
  292.     "secondary_authors": [
  293.       {
  294.         "first_name": "Manmeet",
  295.         "last_name": "Gujral"
  296.       }
  297.     ]
  298.   },
  299.   {
  300.     "title": "Another Manuscript (Under Review)",
  301.     "affiliation": "Fringilla Company",
  302.     "status_date": new Date(),
  303.     "status": "under review",
  304.     "document": null,
  305.     "number_pages": null,
  306.     "order": null,
  307.     "page_start": null,
  308.     "submitting_author": insertedAuthors.insertedIds[4],
  309.     "editor_id": insertedEditors.insertedIds[0],
  310.     "ricode": insertedCodes.insertedIds[0],
  311.     "issue_id": null,
  312.     "reviewers": [
  313.       insertedReviewers.insertedIds[0],
  314.       insertedReviewers.insertedIds[1],
  315.       insertedReviewers.insertedIds[3],
  316.     ],
  317.     "feedback": [
  318.       {
  319.         "reviewer": insertedReviewers.insertedIds[0],
  320.         "appropriateness": 10,
  321.         "clarity": 4,
  322.         "methodology": 9,
  323.         "contribution": 10,
  324.         "recommended_to_accept": true,
  325.         "date_received": new Date()
  326.       }
  327.     ]
  328.   },
  329.   {
  330.     "title": "Another One (Accepted)",
  331.     "affiliation": "Fringilla Company",
  332.     "status_date": new Date(),
  333.     "status": "accepted",
  334.     "document": null,
  335.     "number_pages": null,
  336.     "order": null,
  337.     "page_start": null,
  338.     "submitting_author": insertedAuthors.insertedIds[0],
  339.     "editor_id": insertedEditors.insertedIds[0],
  340.     "ricode": insertedCodes.insertedIds[3],
  341.     "issue_id": null,
  342.     "reviewers": [
  343.       insertedReviewers.insertedIds[1],
  344.       insertedReviewers.insertedIds[2],
  345.       insertedReviewers.insertedIds[3],
  346.     ],
  347.     "feedback": [
  348.       {
  349.         "reviewer": insertedReviewers.insertedIds[1],
  350.         "appropriateness": 10,
  351.         "clarity": 10,
  352.         "methodology": 9,
  353.         "contribution": 10,
  354.         "recommended_to_accept": true,
  355.         "date_received": new Date()
  356.       },
  357.       {
  358.         "reviewer": insertedReviewers.insertedIds[2],
  359.         "appropriateness": 8,
  360.         "clarity": 10,
  361.         "methodology": 9,
  362.         "contribution": 9,
  363.         "recommended_to_accept": true,
  364.         "date_received": new Date()
  365.       },
  366.       {
  367.         "reviewer": insertedReviewers.insertedIds[3],
  368.         "appropriateness": 9,
  369.         "clarity": 7,
  370.         "methodology": 9,
  371.         "contribution": 10,
  372.         "recommended_to_accept": true,
  373.         "date_received": new Date()
  374.       }
  375.     ]
  376.   },
  377.   {
  378.     "title": "On the Topic of CS Labs (Reviewed + Rejected)",
  379.     "affiliation": "Fringilla Company",
  380.     "status_date": new Date(),
  381.     "status": "rejected",
  382.     "document": null,
  383.     "number_pages": null,
  384.     "order": null,
  385.     "page_start": null,
  386.     "submitting_author": insertedAuthors.insertedIds[0],
  387.     "editor_id": insertedEditors.insertedIds[0],
  388.     "ricode": insertedCodes.insertedIds[1],
  389.     "issue_id": null,
  390.     "reviewers": [
  391.       insertedReviewers.insertedIds[0],
  392.       insertedReviewers.insertedIds[1],
  393.       insertedReviewers.insertedIds[2],
  394.     ],
  395.     "feedback": [
  396.       {
  397.         "reviewer": insertedReviewers.insertedIds[0],
  398.         "appropriateness": 4,
  399.         "clarity": 2,
  400.         "methodology": 3,
  401.         "contribution": 5,
  402.         "recommended_to_accept": false,
  403.         "date_received": new Date()
  404.       },
  405.       {
  406.         "reviewer": insertedReviewers.insertedIds[1],
  407.         "appropriateness": 1,
  408.         "clarity": 3,
  409.         "methodology": 2,
  410.         "contribution": 6,
  411.         "recommended_to_accept": false,
  412.         "date_received": new Date()
  413.       },
  414.       {
  415.         "reviewer": insertedReviewers.insertedIds[2],
  416.         "appropriateness": 3,
  417.         "clarity": 2,
  418.         "methodology": 4,
  419.         "contribution": 3,
  420.         "recommended_to_accept": false,
  421.         "date_received": new Date()
  422.       }
  423.     ]
  424.   },
  425.   {
  426.     "title": "On the Topic of Boredom (Scheduled)",
  427.     "affiliation": "Fringilla Company",
  428.     "status_date": new Date(),
  429.     "status": "scheduled",
  430.     "document": null,
  431.     "number_pages": 3,
  432.     "order": 1,
  433.     "page_start": 1,
  434.     "submitting_author": insertedAuthors.insertedIds[4],
  435.     "editor_id": insertedEditors.insertedIds[0],
  436.     "ricode": insertedCodes.insertedIds[1],
  437.     "issue_id": insertedIssues.insertedIds[1],
  438.     "reviewers": [
  439.       insertedReviewers.insertedIds[0],
  440.       insertedReviewers.insertedIds[1],
  441.       insertedReviewers.insertedIds[2],
  442.     ],
  443.     "feedback": [
  444.       {
  445.         "reviewer": insertedReviewers.insertedIds[0],
  446.         "appropriateness": 7,
  447.         "clarity": 8,
  448.         "methodology": 5,
  449.         "contribution": 9,
  450.         "recommended_to_accept": true,
  451.         "date_received": new Date()
  452.       },
  453.       {
  454.         "reviewer": insertedReviewers.insertedIds[1],
  455.         "appropriateness": 10,
  456.         "clarity": 9,
  457.         "methodology": 6,
  458.         "contribution": 9,
  459.         "recommended_to_accept": true,
  460.         "date_received": new Date()
  461.       },
  462.       {
  463.         "reviewer": insertedReviewers.insertedIds[2],
  464.         "appropriateness": 8,
  465.         "clarity": 8,
  466.         "methodology": 9,
  467.         "contribution": 10,
  468.         "recommended_to_accept": true,
  469.         "date_received": new Date()
  470.       }
  471.     ]
  472.   },
  473.   {
  474.     "title": "On the Topic of Attendance (Published)",
  475.     "affiliation": "Fringilla Company",
  476.     "status_date": new Date(),
  477.     "status": "published",
  478.     "document": null,
  479.     "number_pages": 4,
  480.     "order": 1,
  481.     "page_start": 1,
  482.     "submitting_author": insertedAuthors.insertedIds[5],
  483.     "editor_id": insertedEditors.insertedIds[0],
  484.     "ricode": insertedCodes.insertedIds[1],
  485.     "issue_id": insertedIssues.insertedIds[0],
  486.     "reviewers": [
  487.       insertedReviewers.insertedIds[0],
  488.       insertedReviewers.insertedIds[1],
  489.       insertedReviewers.insertedIds[2],
  490.     ],
  491.     "feedback": [
  492.       {
  493.         "reviewer": insertedReviewers.insertedIds[0],
  494.         "appropriateness": 7,
  495.         "clarity": 8,
  496.         "methodology": 5,
  497.         "contribution": 9,
  498.         "recommended_to_accept": true,
  499.         "date_received": new Date()
  500.       },
  501.       {
  502.         "reviewer": insertedReviewers.insertedIds[1],
  503.         "appropriateness": 10,
  504.         "clarity": 9,
  505.         "methodology": 6,
  506.         "contribution": 9,
  507.         "recommended_to_accept": true,
  508.         "date_received": new Date()
  509.       },
  510.       {
  511.         "reviewer": insertedReviewers.insertedIds[2],
  512.         "appropriateness": 8,
  513.         "clarity": 8,
  514.         "methodology": 9,
  515.         "contribution": 10,
  516.         "recommended_to_accept": true,
  517.         "date_received": new Date()
  518.       }
  519.     ]
  520.   },
  521.   {
  522.     "title": "On the Topic of Time Management (Typeset)",
  523.     "affiliation": "Fringilla Company",
  524.     "status_date": new Date(),
  525.     "status": "typeset",
  526.     "document": null,
  527.     "number_pages": 95,
  528.     "order": null,
  529.     "page_start": null,
  530.     "submitting_author": insertedAuthors.insertedIds[0],
  531.     "editor_id": insertedEditors.insertedIds[0],
  532.     "ricode": insertedCodes.insertedIds[1],
  533.     "issue_id": null,
  534.     "reviewers": [
  535.       insertedReviewers.insertedIds[0],
  536.       insertedReviewers.insertedIds[1],
  537.       insertedReviewers.insertedIds[2],
  538.     ],
  539.     "feedback": [
  540.       {
  541.         "reviewer": insertedReviewers.insertedIds[0],
  542.         "appropriateness": 7,
  543.         "clarity": 8,
  544.         "methodology": 5,
  545.         "contribution": 9,
  546.         "recommended_to_accept": true,
  547.         "date_received": new Date()
  548.       },
  549.       {
  550.         "reviewer": insertedReviewers.insertedIds[1],
  551.         "appropriateness": 10,
  552.         "clarity": 9,
  553.         "methodology": 6,
  554.         "contribution": 9,
  555.         "recommended_to_accept": true,
  556.         "date_received": new Date()
  557.       },
  558.       {
  559.         "reviewer": insertedReviewers.insertedIds[2],
  560.         "appropriateness": 8,
  561.         "clarity": 8,
  562.         "methodology": 9,
  563.         "contribution": 10,
  564.         "recommended_to_accept": true,
  565.         "date_received": new Date()
  566.       }
  567.     ]
  568.   }
  569. ], {
  570.   "ordered": false
  571. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top