-1
我有一個MongoDB的就是喜歡這個 -.net Mongo驅動程序 - 獲取一個沒有查找路徑的對象?
product-data
1234-abcd
items
9012-uiop
name
price
5678-efgh
我知道我want-
product-data.1234-abcd.items.9012-uiop
我想取出這個嵌套對象不解決整個產品的完整路徑設置對象,而不使用find。我已經嘗試了一些東西 -
_database.GetCollection<ProductData>("product-data").Find("1234-abcd.items.9012-uiop"); // Thinks the result of Find is ProductData
_database.GetCollection<ProductItem>("product-data.1234-abcd.items.9012-uiop"); // Thinks the result is a collection (naturally)
我想到了序列化的第二個目的是JSON,然後反序列化入我所期望的類,但似乎是一個黑客。
給定完整路徑,如何使用.Net Mongo Driver以這種方式解析嵌套對象?
這是否傳遞整個數據集或僅被要求在2項? (查看'First()')。我的目標之一是使這個網絡高效,否則我可以用代碼完成所有工作。 –
這個轉移只有一個ProductItem,名稱爲「9012-uiop」 –
好的。我會盡快完成並回復你。謝謝! –