V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐工具
RoboMongo
推荐书目
50 Tips and Tricks for MongoDB Developers
Related Blogs
Snail in a Turtleneck
family
V2EX  ›  MongoDB

关于 Simple References

  •  
  •   family · Nov 28, 2013 · 3856 views
    This topic created in 4540 days ago, the information mentioned may be changed or developed.
    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 replies    1970-01-01 08:00:00 +08:00
    ijse
        1
    ijse  
       Nov 28, 2013
    应该不会吧,, stackoverflow上好多人也推荐用simple reference..
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2882 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 07:21 · PVG 15:21 · LAX 00:21 · JFK 03:21
    ♥ Do have faith in what you're doing.