开发者

Is MongoDB built for a lot of updates?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜