<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dilip Kumar Singh</title>
    <description>The latest articles on DEV Community by Dilip Kumar Singh (@dilipravi084).</description>
    <link>https://dev.to/dilipravi084</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F293144%2F1ec4b7ec-fae6-4d36-9e81-4110a34be43c.jpg</url>
      <title>DEV Community: Dilip Kumar Singh</title>
      <link>https://dev.to/dilipravi084</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dilipravi084"/>
    <language>en</language>
    <item>
      <title>MongoDB Query: Remove duplicate records from the collection except one</title>
      <dc:creator>Dilip Kumar Singh</dc:creator>
      <pubDate>Sat, 21 Mar 2020 10:30:09 +0000</pubDate>
      <link>https://dev.to/dilipravi084/mongodb-query-remove-duplicate-records-from-the-collection-except-one-5hjl</link>
      <guid>https://dev.to/dilipravi084/mongodb-query-remove-duplicate-records-from-the-collection-except-one-5hjl</guid>
      <description>&lt;p&gt;&lt;a href="https://www.codefari.com/2020/03/mongodb-query-remove-duplicate-records.html"&gt;Codefari.com&lt;/a&gt;&lt;br&gt;
var duplicatesIds = [];&lt;br&gt;
db.Employee.aggregate([&lt;br&gt;
        {&lt;br&gt;
            $group: {&lt;br&gt;
                _id: {&lt;br&gt;
                    EmpId: "$EmpId"&lt;br&gt;
                },&lt;br&gt;
                dups: {&lt;br&gt;
                    "$addToSet": "$_id"&lt;br&gt;
                },&lt;br&gt;
                count: {&lt;br&gt;
                    "$sum": 1&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
        }, {&lt;br&gt;
            $match: {&lt;br&gt;
                count: {&lt;br&gt;
                    "$gt": 1&lt;br&gt;
                }&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    ], {&lt;br&gt;
    allowDiskUse: true&lt;br&gt;
}).forEach(function (doc) {&lt;br&gt;
    doc.dups.shift();&lt;br&gt;
    doc.dups.forEach(function (dupId) {&lt;br&gt;
        duplicatesIds.push(dupId);&lt;br&gt;
    })&lt;br&gt;
});&lt;br&gt;
printjson(duplicatesIds); &lt;/p&gt;

&lt;p&gt;db.Employee.remove({_id:{$in:duplicatesIds}}) &lt;br&gt;
db.Employee.find();&lt;/p&gt;

&lt;p&gt;Now we will do an analysis of the above-written query.&lt;br&gt;
1- var duplicatesIds = []: This is an array declaration where this query will push the duplicate IDs.&lt;/p&gt;

&lt;p&gt;2-{$group:{_id:{EmpId:"$EmpId"},dups:{"$addToSet":"$_id"} ,count:{"$sum":1}}}: Here we are grouping the records on behalf of EmpId, and using $addToSet command, we can create an array "dups", and count:{"$sum":1} is counting the duplicate records.&lt;/p&gt;

&lt;p&gt;3- {$match:{count:{"$gt":1}}}: Here we are filtering the records that have a count greater than 1. As the above group pipeline, we are counting the duplicate records on behalf of EmpId.&lt;/p&gt;

&lt;p&gt;4- ForEach: we are iterating records one by one here which are grouped EmpId, here we will find the array of duplicate records, for example &lt;br&gt;
"dups" : [&lt;br&gt;
        ObjectId("5e5f5d20cad2677f9f839327"),&lt;br&gt;
        ObjectId("5e5f5d27cad2677f9f839328"),&lt;br&gt;
        ObjectId("5e5f5cf8cad2677f9f839323")&lt;br&gt;
    ].&lt;/p&gt;

&lt;p&gt;5- doc.dups.shift():Here we are removing one record which will not be deleted, and It means we will delete the duplicates except one document.&lt;/p&gt;

&lt;p&gt;6- doc.dups.forEach(function (dupId): here again, we are iterating the array to push (duplicatesIds.push(dupId)) it records (duplicatesIds)on the above-declared array.&lt;/p&gt;

&lt;p&gt;7- db.Employee.find(): to fetch the records.&lt;br&gt;
Now finally execute the above MongoDB query, and you will find the following records.&lt;/p&gt;

&lt;p&gt;For more details follow the &lt;a href="https://www.codefari.com/2020/03/mongodb-query-remove-duplicate-records.html"&gt;codefari.com&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mongodb</category>
    </item>
    <item>
      <title>Microsoft Azure service model</title>
      <dc:creator>Dilip Kumar Singh</dc:creator>
      <pubDate>Sat, 21 Dec 2019 20:05:23 +0000</pubDate>
      <link>https://dev.to/dilipravi084/microsoft-azure-service-model-2idi</link>
      <guid>https://dev.to/dilipravi084/microsoft-azure-service-model-2idi</guid>
      <description>&lt;p&gt;Cloud computing types are service deployment models that let you choose the level of control over your information and types of services you need to provide. There are three main types of cloud computing services, sometimes called the cloud computing stack because they build on top of one another.&lt;/p&gt;

&lt;p&gt;The first cloud computing type is &lt;a href="https://azure.codefari.com/2018/11/microsoft-azure-service-model.html#iaas"&gt;infrastructure-as-a-service (IaaS),&lt;/a&gt;&lt;a&gt;&lt;/a&gt; which is used for Internet-based access to storage and computing power. The most basic category of cloud computing types, IaaS lets you rent IT infrastructure - servers and virtual machines, storage, networks, and operating systems - from a cloud provider on a pay-as-you-go basis.&lt;/p&gt;

&lt;p&gt;The second cloud computing type is &lt;a href="https://azure.codefari.com/2018/11/microsoft-azure-service-model.html#paas"&gt;platform-as-a-service (PaaS)&lt;/a&gt; which gives developers the tools to build and host web applications. PaaS is designed to give users access to the components they require to quickly develop and operate web or mobile applications over the Internet, without worrying about setting up or managing the underlying infrastructure of servers, storage, networks, and databases.&lt;/p&gt;

&lt;p&gt;The third cloud computing type is &lt;a href="https://azure.codefari.com/2018/11/microsoft-azure-service-model.html#saas"&gt;software-as-a-service (SaaS)&lt;/a&gt; which is used for web-based applications. SaaS is a method for delivering software applications over the Internet where cloud providers host and manage the software applications making it easier to have the same application on all of your devices at once by accessing it in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://azure.codefari.com/2018/11/microsoft-azure-service-model.html#advantage"&gt; Advantage of Azure Services&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azure</category>
    </item>
    <item>
      <title>Microsoft Azure fundamentals</title>
      <dc:creator>Dilip Kumar Singh</dc:creator>
      <pubDate>Sat, 21 Dec 2019 04:49:25 +0000</pubDate>
      <link>https://dev.to/dilipravi084/microsoft-azure-fundamentals-5382</link>
      <guid>https://dev.to/dilipravi084/microsoft-azure-fundamentals-5382</guid>
      <description>&lt;p&gt;Before going on topic Azure fundamental, we need to understand about cloud computing, to start an application over the network we set up a machine with required hardware and software which is called servers/data centers. To set up a server, we pay a massive amount while we don't need all server resources at all times. Suppose we found an option pay as you go for hardware and software then what option you will choose, a heavy investment or pay as you go service. Definitely, I will choose to pay as you go service instead of maintaining CPUs, Storage, Networking, and Required S/w for an application. In pay as you go service, you rent them for the time that you need them. The cloud provider takes care of maintaining the underlying infrastructure for you. &lt;/p&gt;

&lt;p&gt;Finally, Cloud computing is the delivery of computing services over the Internet using a pay-as-you-go pricing model. Put another way, it's a way to rent computing power and storage from someone else's data center.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Microsoft Azure&lt;/b&gt;&lt;br&gt;
There are many providers of cloud computing like AWS by Amazon, Azure by Microsoft, IBM, and Google cloud platform by Google, in this tutorial we will learn about the services of Microsoft Azure cloud computing platform.&lt;br&gt;
Azure is Microsoft's cloud computing platform. Azure is here to help you tackle your toughest business challenges. You bring your requirements, creativity, and favorite software development tools. We bring a massive global infrastructure that's always available for you to build your applications on.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;What can I do on Azure?&lt;/b&gt;&lt;br&gt;
Azure provides over 100 services that enable you to do everything from running your existing applications on virtual machines to exploring new software paradigms such as intelligent bots and mixed reality.&lt;/p&gt;

&lt;p&gt;Many teams start exploring the cloud by moving their existing applications to virtual machines that run in Azure. While migrating your existing apps to virtual machines is a good start, the cloud is more than just "a different place to run your virtual machines".&lt;/p&gt;

&lt;p&gt;&lt;b&gt;For example,&lt;/b&gt; Azure provides AI and machine-learning services that can naturally communicate with your users through vision, hearing, and speech. It also provides storage solutions that dynamically grow to accommodate massive amounts of data. Azure services enable solutions that are simply not feasible without the power of the cloud.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://azure.codefari.com/2018/11/microsoft-azure-fundamentals.html#Benefits%20of%20Azure%20Cloud"&gt;Benefits of Azure Cloud&lt;/a&gt;&lt;br&gt;
&lt;a href="https://azure.codefari.com/2018/11/microsoft-azure-fundamentals.html"&gt;The Azure cloud provides the facility&lt;/a&gt;&lt;/p&gt;

</description>
      <category>azure</category>
    </item>
    <item>
      <title>AWS: AppSync with Lambda Resolver for MongoDB using DotNet core</title>
      <dc:creator>Dilip Kumar Singh</dc:creator>
      <pubDate>Sun, 15 Dec 2019 13:02:45 +0000</pubDate>
      <link>https://dev.to/dilipravi084/aws-appsync-with-lambda-resolver-for-mongodb-using-dotnet-core-3e0p</link>
      <guid>https://dev.to/dilipravi084/aws-appsync-with-lambda-resolver-for-mongodb-using-dotnet-core-3e0p</guid>
      <description>&lt;p&gt;In this article, we will learn how to create an AppSync API with the Lambda function. I will show you how a lambda function is written using the Dotnet core that performs business logic based on invoking graphical field operation. AppSync enables us to use AWS Lambda to resolve any graphing field.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Technology&lt;/b&gt;&lt;br&gt;
Framework- Visual studio 2019&lt;br&gt;
DotNet core and backend database MongoDB&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Prerequisites&lt;/b&gt;&lt;br&gt;
You should have the basic knowledge of .Net Core with C#, Visual Studio, and NoSQL database understanding will be additional.&lt;/p&gt;

&lt;p&gt;This article divided into three parts.&lt;br&gt;
Part 1- Lambda Function development using DotNet core.&lt;br&gt;
Part 2- Deployment on AWS&lt;br&gt;
Part 3 – AppSync API&lt;br&gt;
For more click here &lt;a href="https://www.codefari.com/2019/12/aws-appsync-with-lambda-resolver-for.html"&gt;https://www.codefari.com/2019/12/aws-appsync-with-lambda-resolver-for.html&lt;/a&gt;&lt;/p&gt;

</description>
      <category>aws</category>
      <category>mongodb</category>
      <category>dotnetcore</category>
    </item>
  </channel>
</rss>
