Skip to content

Commit

Permalink
change data scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mstdokumaci committed Mar 29, 2017
1 parent fc2b59f commit ac57af2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default struct => {
)
} else {
client.hset(
`${bucket}|${context}`, JSON.stringify(path), JSON.stringify([val, stamp]),
`${bucket}|${context}`, JSON.stringify(path), JSON.stringify({val, stamp}),
error => {
if (error) {
p.get('root').emit('error', error)
Expand Down Expand Up @@ -80,8 +80,9 @@ export default struct => {
} else {
var result = []
for (let key in replies) {
let [val, stamp] = JSON.parse(replies[key])
result.push({ val, stamp, path: JSON.parse(key) })
let obj = JSON.parse(replies[key])
obj.path = JSON.parse(key)
result.push(obj)
}
fromRedis = true
resolve(result)
Expand Down

0 comments on commit ac57af2

Please sign in to comment.