删除MongoDB中的所有重复项(基于字段)

时间:2015-11-05 04:13:27

标签: python mongodb

我有一个MongoDB数据库(100 GB),我想删除一些重复项。什么是一个简单的方法来解决这个问题?

我正在使用MongoDB 3.0和pymongo与它进行交互。该集合看起来像:

using System.Net;
using System.Net.Http;
using System.Web.Http;

namespace AEMtoParmedInject.Controllers
{
    public class AemToParmedMergeController : ApiController
    {
        private ILogger _logger;
        private IWorkTheMachine _worker;
        public AemToParmedMergeController()
        {
            _logger = new Logger();
            //_worker = worker;
        }

        [HttpGet]
        public HttpResponseMessage Index()
        {
            return new HttpResponseMessage()
            {
                Content = new StringContent(
                    "<html>" +
                        "<head>" +
                        "</head>" +
                        "<body>" +
                            "<p>By click on the button below you are signaling the AEM to Parmed Merge service to perform it task</p>" +
                            "<form>" +
                                "<input type='submit' action='Index' value='Integrate AEM Content'>" +
                            "</form" +
                        "</body>" +
                    "</html>",
                    Encoding.UTF8,
                    "text/html"
                )
            };
        }
    }
}

0 个答案:

没有答案