简体   繁体   中英

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

i use stormdb my database structure:

(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
  }

i want to push in "text" string "hello", use this:

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

but i have error: Error: Can't run.value() on non-existant property of non-existant object.

what can i do?

This means your database is not stored or named the way you think it is.
You might have created it wrong.

Try each of these:


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

If it fails, your database does not exist.


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

If it fails, there is no id '1' entry.


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

If it fails, your 'text' list does not exist.


This will tell you what part of your database or entry is missing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM