简体   繁体   English

Restheart如何删除聚集

[英]Restheart how to delete an aggregration

I have a number of aggregations defined in my mongodb instance and I would like to delete one of them. 我在mongodb实例中定义了许多聚合,我想删除其中一个。

So for example if I had 3 defined in the collections _properties metadata and I wanted to get rid of the second one how would I do it. 因此,例如,如果我在集合_properties元数据中定义了3个,而我想摆脱第二个,我该怎么做。

to create an aggregation you define the aggrs array as a collection property. 要创建聚合, aggrs数组定义为集合属性。

PATCH /db/coll {"aggrs": [ {<aggr1>}, {<aggr2>}, {<aggr3>} ] }

to delete one you just need to update the aggrs property 删除一个,您只需要更新aggrs属性

PATCH /db/coll {"aggrs": [ {<aggr1>}, {<aggr3>} ] }

you can also use the $pull array update operator: 您还可以使用$ pull数组更新运算符:

PATCH /db/coll {"$pull": { "aggrs": { "uri": "mySecondAgg" } } }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM