MongOData icon indicating copy to clipboard operation
MongOData copied to clipboard

Unable to query the ComplexType by $filter

Open shoringfan10 opened this issue 8 years ago • 0 comments

Hi @object, I have the data structure as following,

<EntityType Name="scatterless">
<Key>
<PropertyRef Name="db_id"/>
</Key>
<Property Name="db_id" Type="Edm.String" Nullable="false"/>
<Property Name="dataName" Type="Edm.String"/>
<Property Name="dataValue" Type="Collection(Mongo.scatterless__dataValue)" Nullable="false"/>
</EntityType>

<ComplexType Name="scatterless__dataValue">
<Property Name="x" Type="Edm.Double"/>
<Property Name="y" Type="Edm.Double"/>
<Property Name="z" Type="Edm.Double"/>
</ComplexType>

The main problem is that when I am trying to query and filter the dataValue, for example,

GET MongoDataService.svc/scatterless('id')/dataValue?$filter=x gt 2

It always responses,

Query option $filter cannot be applied to the requested resource.

Whereas, it's doing well to display all data points without $filter,

GET MongoDataService.svc/scatterless('id')/dataValue

The response is, any ideas?

<d:dataValue xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml" m:type="Collection(Mongo.scatterless__dataValue)">
<d:element>
<d:x m:type="Edm.Double">1</d:x>
<d:y m:type="Edm.Double">2</d:y>
<d:z m:type="Edm.Double">2</d:z>
</d:element>
<d:element>
<d:x m:type="Edm.Double">4.5</d:x>
<d:y m:type="Edm.Double">3.3</d:y>
<d:z m:type="Edm.Double">2</d:z>
</d:element>
<d:element>
<d:x m:type="Edm.Double">2.5</d:x>
<d:y m:type="Edm.Double">3.5</d:y>
<d:z m:type="Edm.Double">2</d:z>
</d:element>
<d:element>
<d:x m:type="Edm.Double">1</d:x>
<d:y m:type="Edm.Double">5</d:y>
<d:z m:type="Edm.Double">2</d:z>
</d:element>
<d:element>
<d:x m:type="Edm.Double">8</d:x>
<d:y m:type="Edm.Double">2</d:y>
<d:z m:type="Edm.Double">2</d:z>
</d:element>
</d:dataValue>

shoringfan10 avatar Sep 29 '16 15:09 shoringfan10