当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
Spark GC日志分析
通过斐波那契数再谈函数递归2.0
连续变量离散化教程
尚硅谷–MySQL–基础篇(P1~P95)
一文吃透哈希表
串的基本概念与操作
CentOS7 installation MySQL graphic detailed tutorial
WPF中TabControl动态获取当前选中的TabItem
Markdown编辑器语法
2022年最新重庆建筑安全员模拟题库及答案
JVS函数公式使用场景介绍
Two methods of NameNode failure handling
初识QEMU
Selenium自动化测试之Selenium IDE
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)解决办法
Getting started with jmeter performance testing steps (performance testing tool jmeter)
Chrome开发自定义右键菜单实现快速跳转到指定页面
荣耀手机参数写错,客服认为没错
ERROR 1819 (HY000) Your password does not satisfy the current policy requirements
AMBA APB学习记录(AMBA 3/4)