V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
lagoon
V2EX  ›  数据库

请教一个 NoSQL 的常识问题

  •  
  •   lagoon · Nov 26, 2020 · 1883 views
    This topic created in 1991 days ago, the information mentioned may be changed or developed.

    NoSQL 不是可以存层级关系吗?

    比如把这个 json 直接存库。

    {
        "status": "0000",
        "message": "success",
        "data": {
            "title": {
                "id": "001",
                "name" : "白菜"
            },
            "content": [
                {
                    "id": "001",
                    "value":"你好 白菜"
                },
                {
                    "id": "002",
                     "value":"你好 萝卜" 
                }
            ]
        }
    }
    

    这时我更改了“你好 萝卜”,改成“你好 冬瓜”,然后保存。

    会不会导致整个 json 的所有数据,被重新写入一遍呢?

    App 码农,对数据库不太了解,望指点。

    4 replies    2020-11-26 15:33:03 +08:00
    santiweide
        1
    santiweide  
       Nov 26, 2020
    看你是 update 还是 replace 了
    ebingtel
        2
    ebingtel  
       Nov 26, 2020
    部分 NoSQL 只支持简单的 kv, 比如 redis, 这种情况,content 的内容是需要重写一遍的
    lagoon
        3
    lagoon  
    OP
       Nov 26, 2020
    @santiweide @ebingtel 谢谢。
    ebingtel
        4
    ebingtel  
       Nov 26, 2020
    @lagoon 说错了 是 data 的内容==
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3016 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 593ms · UTC 07:15 · PVG 15:15 · LAX 00:15 · JFK 03:15
    ♥ Do have faith in what you're doing.