插入一条数据,存在就更新,不存在就插入?云数据库如何实现,谢谢

小程序 文章 2020-08-12 10:41 522 0 全屏看文

AI助手支持GPT4.0

插入一条数据,存在就更新,不存在就插入?云数据库如何实现,谢谢Insert a piece of data, update it if it exists, or insert it if it does not exist? How to implement cloud database, thank you

插入一条数据,存在就更新,不存在就插入?云数据库如何实现,谢谢

插入一条数据,存在就更新,不存在就插入?云数据库如何实现

mysql on duplicate key update 可以实现,那么小程序的数据库是如何实现,查看了下数据库的API没有找到好的方法

谢谢。

Insert a piece of data, update it if it exists, insert it if it doesn't exist? How to implement MySQL on duplicate key update for cloud database? How to realize the database of small program? After checking the API of database, no good method was found. Thank you.

回答:

青团社:

通过where查询集合下某个key,查到了你就update,查不到弹窗提醒是否新增,点击你就add?

小肥羊:

同问

-EOF-

AI助手支持GPT4.0