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.

76 lines
1.4 KiB

5 years ago
  1. db.getCollection('experiment_scopes').aggregate(
  2. [
  3. {
  4. $match: {_id: "c50_v[5, 50]_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. $lookup:
  26. {
  27. from: "embeddings",
  28. let:
  29. {
  30. qubo_id: "$wmis_qubo._id",
  31. solver_graph_id: ObjectId("5c9e13168c6fe628c16eb361")
  32. },
  33. pipeline:
  34. [
  35. {
  36. $match:
  37. {
  38. $expr:
  39. {
  40. $and:
  41. [
  42. {$eq: ["$qubo", "$$qubo_id"]},
  43. {$eq: ["$solver_graph", "$$solver_graph_id"]}
  44. ]
  45. }
  46. }
  47. },
  48. {
  49. $project:
  50. {
  51. /*_id: false,
  52. qubo: false,
  53. solver_graph: false,
  54. description: false*/
  55. embeddings: true
  56. }
  57. }
  58. ],
  59. as: "embeddings"
  60. }
  61. },
  62. {
  63. $match: {embeddings: {$exists: true, $not: {$size: 0}}}
  64. },
  65. {
  66. $unwind: "$embeddings"
  67. },
  68. {
  69. $project:
  70. {
  71. _id: false,
  72. instance_id: true,
  73. wmis_qubo: true,
  74. embeddings: "$embeddings.embeddings"
  75. }
  76. }
  77. ])