我有一個數據庫與兩個集合。學生館藏有一個名爲「student_bookselections」的字段,用於保存書籍的ID。該字段的內容通常會被更改或更新。我們如何更新學生選擇?
- 我們如何添加或刪除id到student_bookselections?
- 這是一個體面的方式來關聯集合?
學生收集
array(
"student_id" => 4,
"student_fullname" => $studentfullname,
"student_bookselections" => 'id1, id34, id788 ... ... id4'
)
藏書
array(
"book_id" => 4354,
"book_title" => $title,
"book_author" => $author,
)
? –
@ S.Visser:是的,我正在使用mongodb,但我是一個newby – mustafa