How can i emit multiple values in the map function . Below is the sample
i want to emit “firstName, lastName,phoneNo,emailID, roles, userID, userImageUrl, userPassword, userName” values which are present in a JSON document with some other properties , having emailID as my key . what will the map function look like in c# :
I have written the below emit , but the compiler is throwing error . Please help
But when i query the view as below , how can i get all the above values from obj (which is a value emitted ). I have written the query as below
var query = db.GetView("Sites").CreateQuery();
query.Descending = true;
//query.Limit = 3;
try
{
var results = query.Run();
foreach (var result in results)
{
Dictionary<int, object> doc = new Dictionary<int, object>();
var emailID = result.Key;
var doc = result.Value;
}
}
If i use doc as above i get a compiler error saying to cast the result.Value
when i cast the result.Value to dictionary object no compiler errors , but i get a run time exception
if i use a simple variable like var doc1 = result.value , how will i be able to get all the elements in the dictionary.