如何使用 MongoDB 指南针删除 MongoDB 集合中选定的多条记录 [英] How to delete selected multiple records in a collection in MongoDB using MongoDB compass

查看:65
本文介绍了如何使用 MongoDB 指南针删除 MongoDB 集合中选定的多条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 MongoDB 和 MongoDB Compass 非常陌生.

I'm very new to MongoDB and MongoDB Compass.

我在客户集合中有大约 1000 条记录.如何通过MongoDB指南针一次性删除所有记录.

I have some 1000 records in a customer collection. How I can delete all the records at once through MongoDB compass.

非常感谢,

推荐答案

您可以使用 MongoDB 指南针提供的 Embedded Shell.它现在处于测试模式.我使用的是指南针版本 1.23.0

You can use Embedded Shell provided by the MongoDB compass. Its in beta mode right now. I am using compass version 1.23.0

要删除多条记录,可以使用db..deleteMany
https://docs.mongodb.com/manual/reference/method/db.collection.deleteMany/

To delete multiple records, you can use db.<collectionname>.deleteMany
https://docs.mongodb.com/manual/reference/method/db.collection.deleteMany/

这篇关于如何使用 MongoDB 指南针删除 MongoDB 集合中选定的多条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆