在MongoDB页面中:http://www.mongodb.org/display/DOCS/Inserting
doc = { author: 'joe',
created : new Date('03/28/2009'),
title : 'Yet another blog post',
text : 'Here is the text...',
tags : [ 'example', 'joe' ],
comments : [ { author: 'jim', comment: 'I disagree' },
{ author: 'nancy', comment: 'Good post' } ]}
db.posts.insert(doc);
db.posts.find( { "comments.author" : "jim" } )
Run Code Online (Sandbox Code Playgroud)
当评论超过4MB时,这个文件不起作用吗?我们可以说,它很难超过4MB,但我想一个系统如果仅限于这样的评论的大小或数量,将会有一点限制.如果它是关系模型,那么除了主要用于磁盘空间之外没有这样的限制.
或者是否有其他方式来处理评论,以便它可以是任何大小?
我想你会想要分享4MB的评论.
根据文档,您应该设计为当前的4MB限制.所以有两个想法:
| 归档时间: |
|
| 查看次数: |
2161 次 |
| 最近记录: |