不能 运行 .value() 在不存在的对象 属性 上

Can't run .value() on non-existant property of non-existant object

我用的是stormdb 我的数据库结构:

(id == 1)

[id]: {
    text: [
      "example", "text"
    ],
    pictures: ["111"],
    chance: {
      "global": 20,
      "demotivator": 10,
      "poll": 10,
      "mem": 10,
      "sticker": 10,
      "bugurt": 10,
      "anekdot": 10
    },
    isGold: false
  }

我想输入“text”字符串“hello”,使用这个:

db.get(`conversations`).get(1).get("text").push("hello").save();

但我有错误:错误:不能 运行 .value() on non-existant 属性 of non-existant object.

我能做什么?

这意味着您的数据库没有按照您认为的方式存储或命名。
你可能创建错了。

试试这些:


console.log( db.get( 'conversations' ).value() );

如果失败,则您的数据库不存在。


console.log( db.get( 'conversations' ).get( 1 ).value() );

如果失败,则没有 id '1' 条目。


console.log( db.get( 'conversations' ).get( 1 ).get( "text" ).value() );

如果失败,则您的 'text' 列表不存在。


这会告诉您缺少数据库或条目的哪一部分。