failed to execute 'put' on 'idbobjectstore' evaluating the object store's key path did not yield a value
Asked Answered
M

2

16

A chrome based APP which I am supporting gives us this error. I tried to find out more about the error but was unsuccessful. Can someone kindly explain me on what could be the cause of this.

The Error is as below Image

enter image description here

The put is happening at this snippet var ydbRequest = ydbStorage.put(dbName, data); The dbName: OUTLETS and the data value is:

1.  Action: "Submit"
2.  ChannelGroup: "ZC03"
3.  City: "LA"
4.  CreateDate: Fri Jun 24 2016 10:23:03 GMT-0400 (Eastern Daylight Time)
5.  MUValue: Object
6.  ModifiedDate: Mon Jun 27 2016 11:16:24 GMT-0400 (Eastern Daylight Time)
7.  Mu: "U39 "
8.  Name: "54321"
9.  OutletId: "0000054321"
10. OutletImage: ""
11. Promotion: Object
12. SignatureImage: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZAAAABLCAYAAABeMdGUAAAFTElEQVR4Xu3azcttUxwH8O8l8pKSDMxIUTJQTEwUiZmZlBEzMyV/gPwBUmZGzJTMzIjIxMTgDqSUGBpISl7y3qqz6/Y4z3nOWXc/Z+3ffj6n7uTe/dvrtz5r3f1tv1yKHwECBAgQ6BC41FGjhAABAgQIRIDYBAQIECDQJSBAutgUESBAgIAAsQcIECBAoEtAgHSxKSJAgAABAWIPECBAgECXgADpYlNEgAABAgLEHiBAgACBLgEB0sWmiAABAgQEiD1AgAABAl0CAqSLTREBAgQICBB7gAABAgS6BARIF5siAgQIEBAg9gABAgQIdAkIkC42RQQIECAgQOwBAgQIEOgSECBdbIoIECBAQIDYAwQIECDQJSBAutgUESBAgIAAsQcIECBAoEtAgHSxKSJAgAABAWIPECBAgECXgADpYlNEgAABAgLEHiBAgACBLgEB0sWmiAABAgQEiD1AgAABAl0CAqSLTREBAgQICBB7gMC6BN5K8mmSt9c1LbNZooAAWeKq6IlAv8C3SR5L8l3/KVQS2E9AgOzn5CgCFQTu3Nx93FWhWT3WFxAg9dfQDAhMAs9t7j6eR0LgGAIC5BjKxiBwHAHvP47jbJSNgACxFQisR8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8QxMgQKCygACpvHp6J0CAwEABATIQ39AECBCoLCBAKq+e3gkQIDBQQIAMxDc0AQIEKgsIkMqrp3cCBAgMFBAgA/ENTYAAgcoCAqTy6umdAAECAwX+AwgEXkzfHpKFAAAAAElFTkSuQmCC"
13. State: "NV"
14. Status: "Signed"
15. Street: "11 ABC"
16. TargetCMAID: "54AAFF2ECAFF4410E1008000A7692971"
17. Year: 2015
18. ZipCode: "89201"
19. _disabledStates: Object
20. _displayOrderLimit: Object
21. _recallState: "fsop.outlet.review-sign.summary"
22. _validationStates: Object
23. __proto__: Object

Let me know in case I need to add more details.

TIA

Mullock answered 14/6, 2016 at 14:33 Comment(1)
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example.Ossein
F
22

If your object store has a key path, the object being stored must contain a value pointed at by that key path or must use a key generator ({autoIncrement: true}).

For example:

var store = db.createObjectStore('my_store', {keyPath: 'key'});
store.put({key: 11, value: 33}); // OK
store.put({value: 66}); // throws, since 'key' is not present

var store = db.createObjectStore('my_store', {keyPath: 'key', autoIncrement: true});
store.put({key: 11, value: 33}); // OK, key generator set to 11
store.put({value: 66}); // OK, will have auto-generated key 12
Filiate answered 15/6, 2016 at 12:59 Comment(5)
Hey Josh, I am confused about the line store.put({key: 1, value: 33}); as in how does that bump the key to 33? Did you mean store.put({key: 33, value: 'something'}); in that example? Or maybe I completely missed the boat here and would appreciate any explanation.Fernandes
Whoops, sorry, must have been half asleep. I'll fix the example.Filiate
Hi @JoshuaBell Thanks for your response. I understand that we are putting a value in the given key and in the scenario which I am facing, I have added the key and value details. I am not able to understand if there is any issue with the Value(data in this case) or could it be an issue with dbNameMullock
@Fernandes Tagging you as well. Kindly Help with your suggestionMullock
@JoyShashreek - if you need more help you'll need to provide a subset of your actual code, e.g. the code that creates the object store, and the code trying to store a value with a full JSON serialization if possible, so we can point out where the error is.Filiate
D
0

Answers are wrong. Use "add" as such:

s.add(jsonValue, id);
Dreda answered 4/5 at 16:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.