Regex Google Datastore的查询实体

问题描述 投票:0回答:1

我想在数据存储区模式下使用Firestore在Google App Engine中运行查询。我要完成的是基于正则表达式查询字符串。例如,我想要一个查询,该查询将返回与正则表达式匹配的所有实体。我在docs中找不到有关正则表达式的任何信息。我正在寻找类似于以下代码的内容。

query := datastore.NewQuery(kind).
    Filter("date =", myRegex)
//then run the query and so forth

感谢您的帮助!


编辑:我要实现的正则表达式如下所示:“” 1 / \ d \ d / 2020“

google-app-engine go google-cloud-datastore
1个回答
1
投票

使用以下查询。不需要正则表达式。

query := datastore.NewQuery(kind).
    Filter("date >=", "1/00/2020").
    Filter("date <=", "1/99/2020").
© www.soinside.com 2019 - 2024. All rights reserved.