3 ms·
It would probably work but in my real application it's a bit more complicated since I only want to update a sub-array of the document, like this: collection['so
by Kiro 10y ago
It would probably work but in my real application it's a bit more complicated since I only want to update a sub-array of the document, like this: collection['some_identifier']['items'][3] = 123.
I guess using a plain file would mean I have to overwrite everything on each write which seems wasteful.
- orf 10y agoSure, it depends on your use case though. For infrequent updates I don't think it's wasteful to just overwrite the file, it seems less wasteful to me than running a whole database. But it all depends on your setup :) Also I think updating a sub array in a collection triggers a whole write to that collection in mongodb. In any case I would avoid mongodb if you can, it seems redis might be a better fit for you.