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.

73 lines
1.3 KiB

5 years ago
5 years ago
5 years ago
  1. db.getCollection('experiment_scopes').aggregate(
  2. [
  3. {
  4. $match: {_id: "c45_v[5-45]_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. embeddings: true
  52. }
  53. }
  54. ],
  55. as: "embeddings"
  56. }
  57. },
  58. {
  59. $match: {embeddings: {$exists: true, $not: {$size: 0}}}
  60. },
  61. {
  62. $unwind: "$embeddings"
  63. },
  64. {
  65. $project:
  66. {
  67. _id: false,
  68. instance_id: true,
  69. wmis_qubo: true,
  70. embeddings: "$embeddings.embeddings"
  71. }
  72. }
  73. */
  74. ])