Reputation: 108
So, I have a problem in MongoDB... I have stored some data in MongoDB and it basically looks like:
{
_id: 1,
name: "aa",
importance: [0.5, 0.25, 0.25]
}
Where this importance attribute is an array that I will have to keep updating, e.g., after getting some data, it should be updated to [0.80, 0.10, 0.10]...
In this toy problem, I don't really understand how to replace a full array. Do I have to do it elementwise somehow? If so, it is not a tractable solution in my case, because the number of elements in my array reach above 1000.
Upvotes: 0
Views: 1762