![](/img/trans.png)
[英]Group by id and get order by total count in mongoose express node js
[英]mongoose express node JS link two collection without using _id
您好,我有兩個集合,一個稱為房間,第二個稱為預訂..?
mongodb(貓鼬)中沒有Primary Key
的概念,但在關系數據庫中,如:MySQL、PGSQL 等。
即使你想這樣做,你也可以在 find 操作中使用它,就像:
const bookings = await BookingModel.find({RoomID: inputRoomID});
通過這種方式,您可以獲得帶有inputRoomID
的簡單房間的預訂,如果您想要 go 進一步,即所有房間的預訂,go 用於在 Z758D31F351CE11BF27C522F516CB4C2 中aggregation
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.