You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
1.4 KiB

  1. db.getCollection('experiment_scopes').aggregate(
  2. [
  3. {
  4. $match: {_id: "c42_v[5-42]_1"}
  5. },
  6. {
  7. $unwind: "$instances"
  8. },
  9. {
  10. $project: {"instance_id": "$instances"}
  11. },
  12. {
  13. $lookup:
  14. {
  15. from: "wmis_qubos",
  16. localField: "instance_id",
  17. foreignField: "instance",
  18. as: "wmis_qubo"
  19. }
  20. },
  21. {
  22. $unwind: "$wmis_qubo"
  23. },
  24. {
  25. $project:
  26. {
  27. instance_id: true,
  28. wmis_qubo_id: "$wmis_qubo._id"
  29. }
  30. },
  31. {
  32. $lookup:
  33. {
  34. from: "embeddings",
  35. let:
  36. {
  37. qubo_id: "$wmis_qubo_id",
  38. solver_graph_id: ObjectId("5c9e13168c6fe628c16eb361")
  39. },
  40. pipeline:
  41. [
  42. {
  43. $project:
  44. {
  45. qubo: true,
  46. solver_graph: true,
  47. }
  48. },
  49. {
  50. $match:
  51. {
  52. $expr:
  53. {
  54. $and:
  55. [
  56. {$eq: ["$qubo", "$$qubo_id"]},
  57. {$eq: ["$solver_graph", "$$solver_graph_id"]}
  58. ]
  59. }
  60. }
  61. },
  62. {
  63. $project:
  64. {
  65. _id: true
  66. }
  67. }
  68. ],
  69. as: "embeddings_id"
  70. }
  71. },
  72. {
  73. $unwind: "$embeddings_id"
  74. },
  75. {
  76. $project:
  77. {
  78. instance_id: true,
  79. wmis_qubo_id: true,
  80. embeddings_id: "$embeddings_id._id"
  81. }
  82. }
  83. ])