我有一個csv文件,其行數很大,我想將它存儲在mongodb中。在設計模式時我需要一些建議。用於大型csv文件的mongodb模式
模式類型1:
var CsvSchema = new Schema({
col1: String, col2: String, col3: String, col4: String //will save each row of csv file as an object.
});
模式類型2:
var CsvSchema = new Schema({
row: [] //will store each row of csv file as array
});
我然後需要執行大量的讀取操作該數據(報告的應用程序)的。 我的假設:
- 數據存儲與模式2型將佔據非常小的空間比較 類型1.
- 我猜1型的讀操作會更快然後鍵入2
任何建議我應該使用哪種類型的模式來存儲考慮了兩者的利弊的數據...