ltsharma / expo-sqlite-query-helper

SQLite query helper library for expo-sqlite
MIT License
9 stars 5 forks source link

update method bug #9

Open codthing opened 3 years ago

codthing commented 3 years ago
// A known database table data
[{"fileType":"movie","fileUrl":"a.file"}]
// Operate
const table_name = "table_movie"
const insertData = {"fileType":"movie","fileUrl":"b.file"}

await update(
  table_name,
  insertData,
 {"fileType": "movie"}
)

// Log
error: Provided data is not an array please provide array of object to update, Given data

According to the log in the previous section, I made the following changes, but it still doesn’t work

// Operate
const table_name = "table_movie"
const insertData = {"fileType":"movie,"fileUrl":"b.file"}

const new_indertDta = new Array()
new_indertDta.push(insertData)

await update(
  table_name,
  new_indertDta,
 {"fileType": "movie"}
)

// Log
error: Provided data is not an array please provide array of object to update, Given data