V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐工具
RoboMongo
推荐书目
50 Tips and Tricks for MongoDB Developers
Related Blogs
Snail in a Turtleneck
family
V2EX  ›  MongoDB

关于 Simple References

  •  
  •   family · 2013-11-28 17:59:01 +08:00 · 3243 次点击
    这是一个创建于 3803 天前的主题,其中的信息可能已经有所发展或是发生改变。
    By default all references are stored as a DBRef with the traditional $id, $db and $ref fields but if you want you can configure your references to be simple and only store a MongoId.


    _id: ObjectId("5297115940e7b47c050041ae"),
    created_at: ISODate("2013-11-28T09:48:09Z"),
    user: {
    $ref: "user",
    $id: ObjectId("5295afb940e7b4f8000041a7"),
    $db: "xxx"
    }

    如果用 simple references,就没有 $ref, $db信息了,这样存储空间更小,但会不会存在什么问题?
    1 条回复    1970-01-01 08:00:00 +08:00
    ijse
        1
    ijse  
       2013-11-28 19:51:36 +08:00
    应该不会吧,, stackoverflow上好多人也推荐用simple reference..
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1204 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 23:36 · PVG 07:36 · LAX 16:36 · JFK 19:36
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.