Query Flow
แยกการไหลของ Query ทั่วไปที่เริ่มต้นจาก executeEntity/executeCustomClass และ root aggregation, Atlas Search, Vector Search
1. เลือกบริบทการดำเนินการ
executeEntity(Class<E>, key)
เลือกประเภท entity และคีย์ resolver และชื่อ collection จะถูกกำหนดโดย MongoExecutionContext#getCollectionName(...)
executeCustomClass(Class<E>, key, collectionName)
ระบุประเภทการแมพผลลัพธ์และชื่อ collection จริงโดยตรง
2. การไหลของ Query ทั่วไป
การดำเนินการที่ไม่ต้องการ condition builder เช่น save, saveAll, การดำเนินการแบบกลุ่ม, การลบ entity และ createHistory จะถูกเรียกใช้โดยตรงจาก execution builder ไม่มี terminal update() สาธารณะแยกต่างหาก และการอัปเดตเงื่อนไขจะใช้ atomicUpdate()
3. การไหลที่มีข้อจำกัดใน stage แรก
aggregation()
ผู้ใช้จะต้องจัดโครงสร้าง pipeline Bson ของ Driver ตั้งแต่ stage แรก
search(index)
นี่คือ builder เฉพาะสำหรับ Atlas Search ที่รักษาข้อจำกัดใน stage แรกของ $search/$searchMeta
vectorSearch(index)
นี่คือ builder เฉพาะสำหรับ Vector Search ที่รักษาข้อจำกัดใน stage แรกของ $vectorSearch
4. ช่องทางหลบหนีแบบ Driver-native
• filter ทั่วไป: driverFilter(Bson)
• การจัดเรียง: SortSpec.driver(Bson)
• root aggregation: aggregation().stage(Bson)
• ตัวดำเนินการ/ตัวเลือกการค้นหา: operator(SearchOperator), driverOptions(...), stage(Bson)
• ตัวเลือกการค้นหาเวกเตอร์: query(VectorSearchQuery), driverOptions(...), stage(Bson)
• ตัวเลือกผู้เผยแพร่: customizeQuery(...), customizeAggregation(...)