当前位置:网站首页>sqlalchemy determines whether a field of type array has at least one consistent data with an array
sqlalchemy determines whether a field of type array has at least one consistent data with an array
2022-07-31 12:32:00 【Xiaodou Whole Sugar (Cx)】
If we have a model type column that is a Column(Array(Integer))
An existing requirement is to determine whether there is at least one between the data in the database and the given query arrayis consistent.If the data stored in this array is {1,2,3,4} and the query condition is {1,5,6}, it should return True
You can use overlap
query = DBSession.query(Question).order_by(Question.created_at.desc())query = query.filter(Question.types.overlap([1,5,6]))
https://docs.sqlalchemy.org/en/14/dialects/postgresql.html
边栏推荐
猜你喜欢
串的基本概念与操作
am335x 看门狗驱动&看门狗应用例程序
MySQL日志中“binlog”的三种格式玩起来真爽
Optimization of five data submission methods
电脑重要文件很多,如何备份比较安全?
跨境电商小知识之跨境电商物流定义以及方式讲解
ESP8266-Arduino编程实例-HDC1008温度湿度传感器驱动
Error EPERM operation not permitted, mkdir ‘Dsoftwarenodejsnode_cache_cacach两种解决办法
AMBA APB学习记录(AMBA 2.0)
PyQt5快速开发与实战10.2 复利计算 && 10.3 刷新博客点击量
随机推荐
ESP8266-Arduino编程实例-PIR(被动红外)传感器驱动
【核心概念】图像分类和目标检测中的正负样本划分以及架构理解
Use docker to build mysql master-slave
基本语法(一)
串的基本概念与操作
sqlalchemy 判断一个array 类型的字段是否和一个array有至少一个一致的数据
字符函数和字符串函数
busybox之reboot命令流程分析
Anaconda安装labelImg图像标注软件
CentOS7 —— yum安装mysql
Basic use of dosbox [easy to understand]
深圳某游戏研发公司每个工位都装监控,网友:堪比“坐牢”!
关于我放弃考研这件事儿
跨境电商小知识之跨境电商物流定义以及方式讲解
CentOS7 installation MySQL graphic detailed tutorial
PyQt5 rapid development and actual combat 10.1 Get city weather forecast
ASM外部冗余是否可以替换磁盘
函数的参数
硬盘分区,拓展C盘,不重装系统,不重装D盘软件的全教程。
手撕Verilog PWM呼吸灯