Yes there is one property with index set to unique. I'm not changing
that property though. I'm changing/adding a new property to the object
and I have not created index for this property in objectstore.
var store = db.createObjectStore(
"storeName",
{keyPath: "id", autoIncrement: true}
);
....
store.createIndex("property1", "property1", { unique: true })
store.createIndex("property2", "property2", { unique: false })
....
store.add({'property1' : 'a', 'property2 : 'b'})
....
store.put({ id:5, 'property1' : 'a', 'property2' : 'b',
'newProperty' : 'test' })
On Jan 3, 8:36 pm, Joshua Bell <
jsb...@chromium.org> wrote:
> That error should only be returned if the object store has an index with a
> unique constraint (pretty much what the error reports). Can you check the
> indexes on the store to see if that might explain what you're seeing?
>
> On Tue, Jan 3, 2012 at 6:56 PM, tech4computer <
tech4compu...@gmail.com>wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > I'm getting following error on store.put(obj) :
> > "One of the derived (from a keyPath) keys for an index does not
> > satisfy its uniqueness requirements."
>
> > The 'obj' contains the original 'id' (e.g.
obj.id=5) and an updated
> > property e.g. obj.test="new value".
> > The keypath is an autoincrement id.
>
> > The store.put(obj) used to work fine, but stopped working sometime
> > ago.
>
> > Thx
>
> > --
> > Chromium Discussion mailing list:
chromium-disc...@chromium.org