如何從數組中刪除重複的條目?如何從數組中刪除重複的條目?
在下面的例子中,「C++中的算法」被添加兩次。
$ unset修飾符刪除特定的字段,但如何從字段中刪除條目?
> db.users.find()
{ "_id" : ObjectId("4f6cd3c47156522f4f45b26f"),
"favorites" : { "books" : [ "Algorithms in C++",
"The Art of Computer Programmning",
"Graph Theory",
"Algorithms in C++" ] },
"name" : "robert" }
謝謝,非常有用的鏈接.. – 2012-03-26 05:45:54
不要發佈只是鏈接,其中一個現在已經損壞:( – Puce 2015-06-04 10:38:57