Skip to content

data type is changing between .hset() and .hget() #727

@eakl

Description

@eakl

.hget() does not return the type that has been set with .hset()

await kv.hset(`key`, { code1: '123456', code2: '000001' }) // code is a string
const value = await kv.hgetall(`key`)
console.log(typeof value.code1) // code is a number
console.log(typeof value.code2) // code is a string

With automaticDeserialization: false as mentioned here: #250

console.log(typeof value) // value is an 'object'
console.log(typeof value.code) // code is undefined
console.log(typeof JSON.parse(value)) // is not a valid JSON

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions