开发者

Is MongoDB built for a lot of updates?

开发者 https://www.devze.com 2023-02-02 05:28 出处:网络
I\'m creating a blog. Everytime someone views the page of a blog, can I do this开发者_运维百科:

I'm creating a blog.

Everytime someone views the page of a blog, can I do this开发者_运维百科:

post['views'] += 1
db.collection.save(post)

I don't index 'views'.


You should use $inc (or your driver's implementation), it does an atomic update.

You should be good, but as with anything it will depend on your traffic volume.

0

精彩评论

暂无评论...
验证码 换一张
取 消