populateResults.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /**
  2. * Results of populate() queries using our test data.
  3. * @type {Object}
  4. */
  5. module.exports = {
  6. // 1..N..1 (Pretty much like reverse populate)
  7. message___message_to_user: [{
  8. id: 10,
  9. subject: 'msgA',
  10. body: 'A test message.',
  11. from: 1,
  12. to: [{
  13. '.message_id': 10,
  14. '.user_id': 2,
  15. '.id': 1
  16. }, {
  17. '.message_id': 10,
  18. '.user_id': 3,
  19. '.id': 2
  20. }]
  21. }, {
  22. id: 20,
  23. subject: 'msgB',
  24. body: 'Another test message.',
  25. from: 1,
  26. to: []
  27. }, {
  28. id: 30,
  29. subject: 'msgC',
  30. body: 'Aint sent this one yet.',
  31. from: null,
  32. to: []
  33. }],
  34. // N..M Populate
  35. message___message_to_user___user: [{
  36. id: 10,
  37. subject: 'msgA',
  38. body: 'A test message.',
  39. from: 1,
  40. to: [{
  41. '..email': 'a@recipient.com',
  42. '..id': 2,
  43. }, {
  44. '..email': 'b@recipient.com',
  45. '..id': 3,
  46. }]
  47. }, {
  48. id: 20,
  49. subject: 'msgB',
  50. body: 'Another test message.',
  51. from: 1,
  52. to: []
  53. }, {
  54. id: 30,
  55. subject: 'msgC',
  56. body: 'Aint sent this one yet.',
  57. from: null,
  58. to: []
  59. }]
  60. };