lagoon
V2EX  ›  数据库

请教一个 NoSQL 的常识问题

  •  
  •   lagoon · Nov 26, 2020 · 2295 views
    This topic created in 2184 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
    santiweide
    Nov 26, 2020
    1
    看你是 update 还是 replace 了
    ebingtel
    ebingtel
    Nov 26, 2020
    2
    部分 NoSQL 只支持简单的 kv, 比如 redis, 这种情况,content 的内容是需要重写一遍的
    lagoon
    lagoon
    OP
    Nov 26, 2020
    3
    @santiweide @ebingtel 谢谢。
    ebingtel
    ebingtel
    Nov 26, 2020
    4
    @lagoon 说错了 是 data 的内容==
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4665 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 158ms · UTC 01:52 · PVG 09:52 · LAX 17:52 · JFK 20:52
    ♥ Do have faith in what you're doing.