Question: I am trying to read a MongoDB document looking like this

```
{
"_id":"a770cf8d-a2ec-45a0-8289-b312c6315997"
"foo1":"value of foo1",
"foo2":"value of foo2"
}

```

I am using the C# driver. The problem is that I get the following error: 

```
Cannot deserialize a 'Guid' from BsonType 'Int32'.

```

My C# code looks like this:

```
var myCollection = myDatabase.GetCollection<MyType>(this.collectionName);
List<MyType> myThings = myCollection.Find(Builders<MyType>.Filter.Empty).ToList();

```

MyType looks like this:

```
[DataContract]
public class MyType
{
    [DataMember(Name="_id")]
    [BsonId(IdGenerator = typeof(CombGuidGenerator))]
    public Guid Id { get; set; }

    [DataMember(Name = "foo1")]
    [BsonElement("foo1")]
    public string Foo1{ get; set; }

    [DataMember(Name = "foo2")]
    [BsonElement("foo2")]
    public string Foo2{ get; set; }
}

```

Answer: 
you are getting incorrect JSON of CityRating Array from server

here is an workaround
Define the function in your component

```
getJson(x){
  let z = x.replace(/'/g, '"');
  return JSON.parse(z);
}

```

to use in you template

```
<div *ngFor="let city of 
getJson(optCities[0].resultData.Hoteloption[0].CityRating);let i = 
 index; ">
  {{city.Rating}}
</div>

```

the function will return you an vaild JSON Array so your loop will work
That's because your JSON object is wrong. Remove the double quotes from the array in CityRating.

```
var optCities = [{
"resultData": {
"Hoteloption": [
{   
    "CityRating":[
    {'City': 'Bangkok','Rating':4.5},
    {'City': 'Phuket','Rating':4.5},
    {'City': 'Nonthaburi','Rating':4.5},
    {'City': 'Broc','Rating':4.5}]
}]
}}];

```