Skip to main content

Posts

Showing posts from August, 2016

Featured post

XM Cloud content sync from prod to uat or UAT to prod step by step

When working with Sitecore, it’s common to need content synchronization across environments. Today, I’ll walk you through the steps to sync content from Production to UAT/TEST and vice versa. Steps to Follow 1. Set Up Your Workspace Create a folder on your computer where you will manage the script files and exported data. Open the folder path in PowerShell to begin scripting. We need to run some scripts in PowerShell to update the folder with the basic requirements for syncing content. PS C:\Soft\ContentSync> dotnet new tool-manifest PS C:\Soft\ContentSync> dotnet nuget add source -n Sitecore https://nuget.sitecore.com/resources/v3/index.json PS C:\Soft\ContentSync> dotnet tool install Sitecore.CLI PS C:\Soft\ContentSync> dotnet sitecore cloud login If the above error occurs, you will need to run a different command to resolve the issue. PS C:\Soft\ContentSync> dotnet sitecore init now, Again run above command to open and authenticate with XM Cloud. It will be there a...

MongoDB Quiz 11, Week 4 for .NET Developers of Index Creation, Background

Answer of Quiz 11  Week 4   is given below MongoDB  of  Index Creation, Background.

MongoDB Quiz 10, Week 4 for .NET Developers of Index Creation, Sparse

Answer of Quiz 10  Week 4   is given below MongoDB  of  Index Creation, Sparse.

MongoDB Quiz 8, Week 4 for .NET Developers of Dot Notation and Multikey

Answer of Quiz 8  Week 4   is given below MongoDB  of  Dot Notation and Multikey. Command in the shell of MongoDB to create an index on the company descending is give below. Ans :-  db.people.createIndex( { "work_history.company" : -1 } );

MongoDB Quiz 7, Week 4 for .NET Developers of Multikey Indexes

Answer of Quiz 7  Week 4   is given below MongoDB  of Multikey Indexes.

MongoDB Quiz 6, Week 4 for .NET Developers of Discovering (and Deleting) Indexes

Answer of Quiz 6  Week 4   is given below MongoDB  of  Discovering (and Deleting) Indexes.

MongoDB Quiz 4, Week 4 for .NET Developers of Indexes

Answer of Quiz 4  Week 4   is given below of MongoDB  of Indexes.

MongoDB Quiz 3, Week 4 for .NET Developers of Storage Engines: WiredTiger

Answer of Quiz 3  Week 4   is given below of MongoDB  of Storage Engines: WiredTiger.

MongoDB Quiz 2, Week 4 for .NET Developers of Storage Engines: MMAPv1

Answer of Quiz 2  Week 4   is given below MongoDB  of Storage Engines: MMAPv1.

MongoDB Quiz 1, Week 4 for .NET Developers of Storage Engines

Answer of Quiz 1  Week 4   is given below of MongoDB  of Storage Engines.

MongoDB Quiz 7, Week 3 for .NET Developers Trees

Answer of Quiz 7 is given below of MongoDB  Trees .

MongoDB Quiz 6, Week 3 for .NET Developers One to Many Relations

Answer of Quiz 6 is given below of MongoDB One to Many Relations.

MongoDB Quiz 5, Week 3 for .NET Developers One to One Relations

Answer of Quiz 5 is given below of Mongodb One to One Relations.

MongoDB Quiz 4, Week 3 for .NET Developers Living Without Transactions

Answer of Quiz 3 is given below of Mongo Living Without Transactions.

MongoDB Quiz 3, Week 3 for .NET Developers Mongo Living Without Constraints

Answer of Quiz 3 is given below of Mongo Living Without Constraints.

MongoDB Quiz 2, Week 3 for .NET Developers Mongo Design for Blog

Answer of MongoDB Quiz 2 of week 3 for .Net Developers. Data access pattern is not supported by blog schema is "Providing a table of contents by tag".

MongoDB Quiz 1, Week 3 for .NET Developers MongoDB Schema Design

Answer of MongoDB Quiz 1 of week 3 for .net developer on schema design is given below in image.

Homework 3.1 MongoDB for .Net Development

MongoDB Homework 3.1 for the .Net Development is given below step by step. Step1 :Download student.json from Download handout which is in homework url. Use the below command to drop and import new data of student in MongoDB by using mongoimport command. mongoimport --drop -d school -c students students.json There should be two hundred record in the student collection. First check the data which is correctly imported or not. see below command which help to find data in MongoDB collections use school db.students.count() Correct output of count will be two hundred. Now we need to find the student with highest average in the class . Use below query to get answer. db.students.aggregate( [ { '$unwind': '$scores' }, { '$group': { '_id': '$_id', 'average': { $avg: '$scores.score' } } }, { '$sort': { 'average' : -1 } }, { '$limit': 1 } ] ) You will get the out fr...

Homework 2.5 MongoDB for .Net Development

MongoDB Homework 2.5 Answer is given below in Image. I have executed query for video.movieDetails Collection and get exact answer which is given below.

Homework 2.4 MongoDB for .Net Development

MongoDB Homework 2.4 Answer is given below in Image. I have executed query for video.movieDetails Collection and get exact answer which is given below.

Homework 2.3 MongoDB for .Net Development Blog User Registration & Login

MongoDB .net development for user registration and login. I am going to explain step by step to learn registration and login in .net web application development. First of all download the handout from Homework 2.3 and extract it. Open it with visual studio 2013 or above version. Make sure DLL for MongoDB driver is added in your project otherwise download it with the help of Nugget Package manager. Now going to explain to write missing code in different CS file of project. First open User.CS file from your project .You may see there is marked with XXX sign . Replace your Code with below given. using System; using System.Collections.Generic; using System.Linq; using System.Web; using MongoDB.Bson.Serialization.Attributes; namespace M101DotNet.WebApp.Models { public class User { [BsonRepresentation(MongoDB.Bson.BsonType.ObjectId)] public string Id { get; set; } public string Name { get; set; } public string Email { ...

Homework 2.2 MongoDB for .Net Development

Download JSON data from homework 2.2 MongoDB of .Net development and use it to restore in MongoDB Database. Dataset contains four scores which each has two hundred students. First confirm that you have restored data correctly. Use below command to check your restored data. Data count should be 800. use students db.grades.count() Now , Lets find student who holds 101st across among grades. See the below query to find. db.grades.find().sort( { 'score' : -1 } ).skip( 100 ).limit( 1 ) Correct result is given below by executing the above query. { "_id" : ObjectId("50906d7fa3c412bb040eb709"), "student_id" : 100, "type" : "homework", "score" : 88.50425479139126 } Use below query for sorting of  data, Here I have use limit of 5 show it will show five record. db.grades.find( { }, { 'student_id' : 1, 'type' : 1, 'score' : 1, '_id' : 0 } ).sort( { 'student_id' : 1, ...

MongoDB Quiz 8, Week 2 for .NET BulkWrite

Answer of MongoDB Quiz 8 BulkWrite.

MongoDB Quiz 7, Week 2 for .NET DeleteOne and DeleteMany

Answer of MongoDB Quiz 7 DeleteOne and DeleteMany.

MongoDB Quiz 1, Week 1 for DBAs

MongoDB Quiz 6, Week 2 for .NET driver, Find with Skip, Limit and Sort

Answer of MongoDB  Quiz 6 is given below. Below query make confuse to understand but it's very easy to understand .First line of query is  Limit(10) and skip(5) from 10 so that remaining will be 5. However another Limit(20) get the 20 show no any such value get from previous query .so that final result will be 20. col.Find(new BsonDocument()) .Limit(10) .Skip(5) .Limit(20);

MongoDB Quiz 5, Week 2 for .NET driver, Find with Filters

Answer of Quiz 5 MongoDB Find with Filters class Person { [BsonElement("name")] public string Name; [BsonElement("age")] public int Age; } var col = db.GetCollection<Person>("people"); var list = await col.Find(x => x.Name == "James" && x.Age <= 24).ToListAsync();

MongoDB Quiz 4 Week 2 for .NET driver, Find

Below answer which not able to enumerate query result . Remaining all can enumerate query result from collection of MongoDB data. Below three given method you may use to enumerate result by using C# in .Net applications. 1. ForEachAsync 2. ToListAsync 3. ToCursorAsync

MongoDB Quiz 3 Week 2 for .NET driver, InsertOne

This is Quiz so i have not added proper code here . Here i have just call a collection "People" to add some data. Below you may check exact answer of this question. var people = db.GetCollection<BsonDocument>("people"); var person = new BsonDocument { { "name", "Craig Wilson" }, {"company", "MongoDB" } }; await people.InsertOneAsync(person); person.Remove("_id"); await people.InsertOneAsync(person);

MongoDB Quiz 2 Week 2 for .NET driver, Document Representation

Answer of .Net driver document representation is given below. You may check from below attached image of Quiz 2 answer of week 2.

MongoDB Quiz 1 Week 2 for .Net Driver

Which assembly contains MongoDb Client Class ? 1. MongoDB.Client 2. MongoDB.Driver.Core 3. MongoDB.BSON 4. MongoDB.Driver Answer is  :  4. MongoDB.Driver How to install MongoDB Driver in .net applications? First create a project which you may required. Select reference  in your project and select Nugget Package manager.This will open new window to install any package which you requre. Search Mongo Driver in search box . select MongoDB Driver and install it.You may see in below figure.

Homework 2.1 MongoDB for .Net Development

Download JSON data from homework 2.1 MongoDB of .Net development and use it to restore in MongoDB Database. Command is use to restore JSON data is below. mongoimport --drop -d students -c grades grades.json Data should be 800 inside collection which was restore .Check this by using following command. use students db.grades.count() Use below command to find exact answer. db.grades.aggregate({'$group':{'_id':'$student_id', 'average':{$avg:'$score'}}}, {'$sort':{'average':-1}}, {'$limit':1})

Homework 1.2 MongoDB for .Net Development

Answer of MongoDB homework 1.2 for .Net course of MongoDB. Valid JSON documents are given below in image

Homework 1.1 MongoDB for .Net Development

MongoDB homework 1.1 for .Net course of MongoDB Course. First download MongoDB from mongodb website and install it on your computer. and download homework hangout hw1.1 and uncompressed it . use the command to restore file in your mongdb mongorestore dump Use the command to find your answer. db.hw1.findone() Answer of  MongoDB homework 1.1 is  :   42

What is MongoDB?

MongoDB is a document database.when we do  query with mongodb and data stored in MongoDB we need to use JSON or javascript object Notation. example of JSON Data which can insert in MongoDB. 1. Example :- { "title" : "Star Wars", "quotes" : [ "Use the Force", "These are not the droids you are looking for" ], "director" : "George Lucas" } { "a" : 1, "b" : { "b" : 1, "c" : "foo", "d" : "bar", "e" : [1, 2, 4] } } and it can also be blank JSON data which is { }.