i have doubt modeling collections in mongodb.
i'm working on scientific application generates big matrix m x m, on order of 13,000 columns , rows. can see in example below matrix :
|----------------|----------------|----------------|----------------| | | attribute1 | attribute2 | attribute3 | |----------------|----------------|----------------|----------------| | **attribute1** | 1 | -0.398482 | 0.384382 | | **attribute2** | -0.398482 | 1 | -0.48327 | | **attribute3** | 0.384382 | -0.48327 | 1 | |----------------|----------------|----------------|----------------|
unfortunately, size of array large, array can not store in single document. store entire array in single document because document won't updated, insert , find_one commands applied entire document, facilitate work.
does have idea how solve problem?
i thought of split array storing 1 row @ time in each document. example below:
{ {'row_number':1}, {'attribute': 'attribute1'}, {'values': [1,-0.398482,0.384382]} }
does make sense, or have other better solutions this?
thank much!
since refer both rows , columns attribute names, think might object of objects:
{ attribute1: { attribute1: 1, attribute2: -0.398482, attribute3: 0.384382 }, attribute2: { attribute1: -0.398482, attribute2: 1, attribute3: -0.48327 }, attribute3: { attribute1: 0.384382, attribute2: -0.48327, attribute3: 1 } }
each item in collection object of 13,000 properties, , each property have 13,000 properties, resulting in crazy 169 million properties when flattened.
your approach increase size constant, i'm not sure adds value, since can't see case when may refer vector row number instead of attribute name.
you can transpose object if think you'll more run operations against columns against rows.
Comments
Post a Comment