collections - 删除 ATL ATLAS 转换语言中每个集合的重复项
问题描述
我有一组包含字段的文档(NoSql 文档),每个字段都包含一个键,如下面的元模型所示:Nosql 元模型
我的问题:我如何才能从所有文档中只获取唯一键,我尝试了使用此代码的助手:
helper context MDB_metamodel!collection def: MongoToSql1():
String='\n------------------------------------ \n -- ********* Creation of table '+self.name+ ' **'+'\n\n'+
'CREATE TABLE `' + self.name + '` ( \n'
+self.document->asSequence()->
iterate(d;acc:String=''|acc+ if acc='' then acc+d.field.asSet()->
collect(f|f.key.MongoToSql12()) else ', \n' + if d.field.asSet()->
collect(f|f.key.MongoToSql12()) <> acc then d.field.asSet()->
collect(f|f.key.MongoToSql12()) else '' endif endif)
;
解决方案
推荐阅读
- java - android.view.InflateException: Binary XML file line #0: Binary XML file line #0: Error inflating class
- php - 正则表达式来修复我的仅部分重复格式的长字符串
- java - 从 JRun 相关代码迁移到 Tomcat 时遇到问题 - ColdFusion 8 到 ColdFusion 2016
- ios - 以编程方式创建输入附件视图
- java - Vaadin Accordion 与选项卡中的按钮
- php - 选择选项“已选择”中的 PHP 多个条件
- python - Hermitian 矩阵的特征向量
- c# - 一对多 MVC 个人用户帐户
- python-3.x - Pyomo 抽象模型 - 运输中的单位成本是运输数量的函数
- testing - 运行 diskspd 时出错