# 操作

查找

```shell
db.Asset.find({'_id':25}).pretty()

db.Vm_vulnerability.find({"asset":"10.222.2.105"}).count()

db.event_manage.find({"asset":"191.133.33.94"}).pretty()
```

更新

```shell
db.Vm_vulnerability.update({'data_type':'loophole'},{$set:{'last_time':ISODate("2020-09-03T11:27:39Z")}},false,true)

db.Asset.update({'_id':25},{$set:{'device':{"classify1_id" : 1,"classify_id" : 10000, "magnitude" : 5, "online" : 1,"approved_time" : 1}}},false,true)

db.threat_manage.update({"uuid" : "event_304faef2-57c7-11eb-ae98-fefcfe0ea541"},{$set:{"risk_level" : "middle"}},false,true) 

db.Vm_vulnerability.update({ "_id" : ObjectId("5fbe1257cb34311b167929ee")},{$set:{"last_time" : ISODate("2021-01-18T06:50:58Z")}},false,true) 
# isodate比现实的时间早了8个小时

db.event_manage.update({},{$set:{"latest_time":ISODate("2021-01-20T06:35:55Z")}},false,true)

db.Asset.update({'_id':11},{$set:{"interfaces":{"ips" : {"::0a00:0001" : {"first_seen" : 1610005210,"last_seen" : 1612437341}}
}}},false,true)
```

删除

```shell
db.Vm_vulnerability.remove({"_id":ObjectId("5fe2ac4bc708adf2a66210e7")})

```

脆弱性更新时间之后，需要删除中间表，重新生成查看

```shell
 db.VulRiskMiddle.drop()

 
```

```
curl -XPOST 'http://10.60.215.40:9200/label_log-v1-2021_01_19d/RqyFGncBqYEnyKrjVGbr/_update?pretty' -H 'Content-Type: application/json' -d ' {
    "doc": {
        "attackCount": 101
    }
}'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://qiangrens-organization.gitbook.io/qkd90/fu-wu-qi-yun-wei-he-ce-shi/linux-fu-wu-qi/cao-zuo.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
