推荐工具
RoboMongo
推荐书目
50 Tips and Tricks for MongoDB Developers
Related Blogs
Snail in a Turtleneck
family
V2EX  ›  MongoDB

关于 Simple References

  •  
  •   family · Nov 28, 2013 · 3919 views
    This topic created in 4576 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   ·   998 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:27 · PVG 06:27 · LAX 15:27 · JFK 18:27
    ♥ Do have faith in what you're doing.